Changeset 35 for trunk/cleanup.php
- Timestamp:
- Apr 8, 2018, 4:41:57 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cleanup.php
r32 r35 44 44 write_log( "$me: debug db=$db; requestID=$requestID" ); 45 45 46 $us3_link = mysql _connect( $dbhost, $user, $passwd);46 $us3_link = mysqli_connect( $dbhost, $user, $passwd, $db ); 47 47 48 48 if ( ! $us3_link ) 49 49 { 50 write_log( "$me: could not connect: $dbhost, $user, $passwd " );50 write_log( "$me: could not connect: $dbhost, $user, $passwd, $db" ); 51 51 mail_to_user( "fail", "Internal Error $requestID\nCould not connect to DB" ); 52 return( -1 );53 }54 55 $result = mysql_select_db( $db, $us3_link );56 57 if ( ! $result )58 {59 write_log( "$me: could not select DB $db" );60 mail_to_user( "fail", "Internal Error $requestID\n$could not select DB $db" );61 52 return( -1 ); 62 53 } … … 65 56 $query = "SELECT email, investigatorGUID, editXMLFilename FROM HPCAnalysisRequest " . 66 57 "WHERE HPCAnalysisRequestID=$requestID"; 67 $result = mysql _query( $query, $us3_link);58 $result = mysqli_query( $us3_link, $query ); 68 59 69 60 if ( ! $result ) 70 61 { 71 62 write_log( "$me: Bad query: $query" ); 72 mail_to_user( "fail", "Internal Error $requestID\n$query\n" . mysql _error( $us3_link ) );63 mail_to_user( "fail", "Internal Error $requestID\n$query\n" . mysqli_error( $us3_link ) ); 73 64 return( -1 ); 74 65 } 75 66 76 list( $email_address, $investigatorGUID, $editXMLFilename ) = mysql _fetch_array( $result );67 list( $email_address, $investigatorGUID, $editXMLFilename ) = mysqli_fetch_array( $result ); 77 68 78 69 $query = "SELECT personID FROM people " . 79 70 "WHERE personGUID='$investigatorGUID'"; 80 $result = mysql _query( $query, $us3_link);81 82 list( $personID ) = mysql _fetch_array( $result );71 $result = mysqli_query( $us3_link, $query ); 72 73 list( $personID ) = mysqli_fetch_array( $result ); 83 74 84 75 $query = "SELECT clusterName, submitTime, queueStatus, method " . … … 87 78 "AND h.HPCAnalysisRequestID=r.HPCAnalysisRequestID"; 88 79 89 $result = mysql _query( $query, $us3_link);90 91 if ( ! $result ) 92 { 93 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );80 $result = mysqli_query( $us3_link, $query ); 81 82 if ( ! $result ) 83 { 84 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 94 85 return( -1 ); 95 86 } 96 87 97 if ( mysql _num_rows( $result ) == 0 )88 if ( mysqli_num_rows( $result ) == 0 ) 98 89 { 99 90 write_log( "$me: US3 Table error - No records for requestID: $requestID" ); … … 101 92 } 102 93 103 list( $cluster, $submittime, $queuestatus, $jobtype ) = mysql _fetch_array( $result );94 list( $cluster, $submittime, $queuestatus, $jobtype ) = mysqli_fetch_array( $result ); 104 95 105 96 // Get the GFAC ID … … 107 98 "WHERE HPCAnalysisRequestID=$requestID"; 108 99 109 $result = mysql _query( $query, $us3_link);100 $result = mysqli_query( $us3_link, $query ); 110 101 111 102 if ( ! $result ) 112 103 { 113 104 write_log( "$me: Bad query: $query" ); 114 mail_to_user( "fail", "Internal Error $requestID\n$query\n" . mysql _error( $us3_link ) );105 mail_to_user( "fail", "Internal Error $requestID\n$query\n" . mysqli_error( $us3_link ) ); 115 106 return( -1 ); 116 107 } 117 108 118 list( $HPCAnalysisResultID, $gfacID ) = mysql _fetch_array( $result );109 list( $HPCAnalysisResultID, $gfacID ) = mysqli_fetch_array( $result ); 119 110 120 111 // Get data from global GFAC DB then insert it into US3 DB 121 112 122 $result = mysql_select_db( $gDB, $gfac_link ); 113 /* 114 $result = mysqli_select_db( $gfac_link, $gDB ); 123 115 124 116 if ( ! $result ) … … 128 120 return( -1 ); 129 121 } 122 */ 130 123 131 124 $query = "SELECT status, cluster, id FROM analysis " . 132 125 "WHERE gfacID='$gfacID'"; 133 126 134 $result = mysql _query( $query, $gfac_link);127 $result = mysqli_query( $gfac_link, $query ); 135 128 if ( ! $result ) 136 129 { … … 140 133 } 141 134 142 list( $status, $cluster, $id ) = mysql _fetch_array( $result );135 list( $status, $cluster, $id ) = mysqli_fetch_array( $result ); 143 136 144 137 $is_us3iab = preg_match( "/us3iab/", $cluster ); … … 156 149 "WHERE gfacID='$gfacID'"; 157 150 158 $result = mysql _query( $query, $gfac_link);159 160 if ( ! $result ) 161 { 162 write_log( "$me: Bad query:\n$query\n" . mysql _error( $gfac_link ) );163 mail_to_user( "fail", "Internal error " . mysql _error( $gfac_link ) );151 $result = mysqli_query( $gfac_link, $query ); 152 153 if ( ! $result ) 154 { 155 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $gfac_link ) ); 156 mail_to_user( "fail", "Internal error " . mysqli_error( $gfac_link ) ); 164 157 return( -1 ); 165 158 } 166 159 167 list( $analysisID ) = mysql _fetch_array( $result );160 list( $analysisID ) = mysqli_fetch_array( $result ); 168 161 169 162 // Get the request guid (LIMS submit dir name) 170 163 $query = "SELECT HPCAnalysisRequestGUID FROM HPCAnalysisRequest " . 171 164 "WHERE HPCAnalysisRequestID = $requestID "; 172 $result = mysql _query( $query, $us3_link);165 $result = mysqli_query( $us3_link, $query ); 173 166 174 167 if ( ! $result ) 175 168 { 176 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );177 } 178 179 list( $requestGUID ) = mysql _fetch_array( $result );169 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 170 } 171 172 list( $requestGUID ) = mysqli_fetch_array( $result ); 180 173 $output_dir = "$submit_dir/$requestGUID"; 181 174 … … 254 247 "WHERE analysisID = $analysisID " . 255 248 "ORDER BY time "; 256 $result = mysql _query( $query, $gfac_link);249 $result = mysqli_query( $gfac_link, $query ); 257 250 258 251 if ( ! $result ) 259 252 { 260 253 // Just log it and continue 261 write_log( "$me: Bad query:\n$query\n" . mysql _error( $gfac_link ) );254 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $gfac_link ) ); 262 255 } 263 256 … … 268 261 "Processed: $now\n\n" . 269 262 "Queue Messages\n\n" ; 270 if ( mysql _num_rows( $result ) > 0 )271 { 272 while ( list( $message, $time ) = mysql _fetch_array( $result ) )263 if ( mysqli_num_rows( $result ) > 0 ) 264 { 265 while ( list( $message, $time ) = mysqli_fetch_array( $result ) ) 273 266 $message_log .= "$time $message\n"; 274 267 } … … 277 270 "WHERE analysisID = $analysisID "; 278 271 279 $result = mysql _query( $query, $gfac_link);272 $result = mysqli_query( $gfac_link, $query ); 280 273 281 274 if ( ! $result ) 282 275 { 283 276 // Just log it and continue 284 write_log( "$me: Bad query:\n$query\n" . mysql _error( $gfac_link ) );277 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $gfac_link ) ); 285 278 } 286 279 … … 288 281 "WHERE gfacID='$gfacID' "; 289 282 290 $result = mysql _query( $query, $gfac_link);291 list( $queue_msg ) = mysql _fetch_array( $result );283 $result = mysqli_query( $gfac_link, $query ); 284 list( $queue_msg ) = mysqli_fetch_array( $result ); 292 285 293 286 // But let's allow for investigation of other large stdout and/or stderr … … 306 299 $query = "DELETE from analysis WHERE gfacID='$gfacID'"; 307 300 308 $result = mysql _query( $query, $gfac_link);301 $result = mysqli_query( $gfac_link, $query ); 309 302 310 303 if ( ! $result ) 311 304 { 312 305 // Just log it and continue 313 write_log( "$me: Bad query:\n$query\n" . mysql _error( $gfac_link ) );306 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $gfac_link ) ); 314 307 } 315 308 … … 322 315 $message_filename = "$output_dir/$db-$requestID-messages.txt"; 323 316 file_put_contents( $message_filename, $message_log, FILE_APPEND ); 324 // mysql _close( $gfac_link );317 // mysqli_close( $gfac_link ); 325 318 326 319 ///////// … … 328 321 329 322 $query = "UPDATE HPCAnalysisResult SET " . 330 "stderr='" . mysql _real_escape_string( $stderr, $us3_link) . "', " .331 "stdout='" . mysql _real_escape_string( $stdout, $us3_link) . "', " .323 "stderr='" . mysqli_real_escape_string( $us3_link, $stderr ) . "', " . 324 "stdout='" . mysqli_real_escape_string( $us3_link, $stdout ) . "', " . 332 325 "queueStatus='completed' " . 333 326 "WHERE HPCAnalysisResultID=$HPCAnalysisResultID"; 334 327 335 $result = mysql _query( $query, $us3_link);336 337 if ( ! $result ) 338 { 339 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );340 mail_to_user( "fail", "Bad query:\n$query\n" . mysql _error( $us3_link ) );328 $result = mysqli_query( $us3_link, $query ); 329 330 if ( ! $result ) 331 { 332 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 333 mail_to_user( "fail", "Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 341 334 return( -1 ); 342 335 } … … 345 338 $query = "DELETE from analysis WHERE gfacID='$gfacID'"; 346 339 347 $result = mysql _query( $query, $gfac_link);340 $result = mysqli_query( $gfac_link, $query ); 348 341 349 342 if ( ! $result ) 350 343 { 351 344 // Just log it and continue 352 write_log( "$me: Bad query:\n$query\n" . mysql _error( $gfac_link ) );345 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $gfac_link ) ); 353 346 } 354 347 … … 429 422 "mgroupcount = {$otherdata['groupcount']} " . 430 423 "WHERE HPCAnalysisResultID=$HPCAnalysisResultID"; 431 $result = mysql _query( $query, $us3_link);424 $result = mysqli_query( $us3_link, $query ); 432 425 433 426 if ( ! $result ) 434 427 { 435 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );428 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 436 429 } 437 430 … … 450 443 $modelGUID = $noise_data[ 'modelGUID' ]; 451 444 $noiseGUID = $noise_data[ 'noiseGUID' ]; 445 $editGUID = '00000000-0000-0000-0000-000000000000'; 446 if ( isset( $model_data[ 'editGUID' ] ) ) 447 $editGUID = $model_data[ 'editGUID' ]; 452 448 453 449 $query = "INSERT INTO noise SET " . 454 450 "noiseGUID='$noiseGUID'," . 455 451 "modelGUID='$modelGUID'," . 456 "editedDataID=1, " . 452 "editedDataID=" . 453 "(SELECT editedDataID FROM editedData WHERE editGUID='$editGUID')," . 457 454 "modelID=1, " . 458 455 "noiseType='$type'," . 459 456 "description='$desc'," . 460 "xml='" . mysql _real_escape_string( $xml, $us3_link) . "'";457 "xml='" . mysqli_real_escape_string( $us3_link, $xml ) . "'"; 461 458 462 459 // Add later after all files are processed: editDataID, modelID 463 460 464 $result = mysql _query( $query, $us3_link);461 $result = mysqli_query( $us3_link, $query ); 465 462 466 463 if ( ! $result ) 467 464 { 468 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );469 mail_to_user( "fail", "Internal error\n$query\n" . mysql _error( $us3_link ) );465 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 466 mail_to_user( "fail", "Internal error\n$query\n" . mysqli_error( $us3_link ) ); 470 467 return( -1 ); 471 468 } 472 469 473 $id = mysql _insert_id( $us3_link );470 $id = mysqli_insert_id( $us3_link ); 474 471 $file_type = "noise"; 475 472 $noiseIDs[] = $id; … … 498 495 "mrecsGUID='$mrecGUID'," . 499 496 "description='$desc'," . 500 "xml='" . mysql _real_escape_string( $xml, $us3_link) . "'";497 "xml='" . mysqli_real_escape_string( $us3_link, $xml ) . "'"; 501 498 502 499 // Add later after all files are processed: editDataID, modelID 503 500 504 $result = mysql _query( $query, $us3_link);501 $result = mysqli_query( $us3_link, $query ); 505 502 506 503 if ( ! $result ) 507 504 { 508 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );509 mail_to_user( "fail", "Internal error\n$query\n" . mysql _error( $us3_link ) );505 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 506 mail_to_user( "fail", "Internal error\n$query\n" . mysqli_error( $us3_link ) ); 510 507 return( -1 ); 511 508 } 512 509 513 $id = mysql _insert_id( $us3_link );510 $id = mysqli_insert_id( $us3_link ); 514 511 $file_type = "mrecs"; 515 512 $mrecsIDs[] = $id; … … 543 540 "meniscus='$meniscus'," . 544 541 "variance='$variance'," . 545 "xml='" . mysql _real_escape_string( $xml, $us3_link) . "'";546 547 $result = mysql _query( $query, $us3_link);542 "xml='" . mysqli_real_escape_string( $us3_link, $xml ) . "'"; 543 544 $result = mysqli_query( $us3_link, $query ); 548 545 549 546 if ( ! $result ) 550 547 { 551 write_log( "$me: Bad query:\n$query " . mysql _error( $us3_link ) );552 mail_to_user( "fail", "Internal error\n$query\n" . mysql _error( $us3_link ) );548 write_log( "$me: Bad query:\n$query " . mysqli_error( $us3_link ) ); 549 mail_to_user( "fail", "Internal error\n$query\n" . mysqli_error( $us3_link ) ); 553 550 return( -1 ); 554 551 } 555 552 556 $modelID = mysql _insert_id( $us3_link );553 $modelID = mysqli_insert_id( $us3_link ); 557 554 $id = $modelID; 558 555 $file_type = "model"; … … 560 557 $query = "INSERT INTO modelPerson SET " . 561 558 "modelID=$modelID, personID=$personID"; 562 $result = mysql _query( $query, $us3_link);559 $result = mysqli_query( $us3_link, $query ); 563 560 } 564 561 … … 571 568 "resultID=$id"; 572 569 573 $result = mysql _query( $query, $us3_link);570 $result = mysqli_query( $us3_link, $query ); 574 571 575 572 if ( ! $result ) 576 573 { 577 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );578 mail_to_user( "fail", "Internal error\n$query\n" . mysql _error( $us3_link ) );574 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 575 mail_to_user( "fail", "Internal error\n$query\n" . mysqli_error( $us3_link ) ); 579 576 return( -1 ); 580 577 } … … 595 592 "WHERE noiseID=$noiseID"; 596 593 597 $result = mysql _query( $query, $us3_link);594 $result = mysqli_query( $us3_link, $query ); 598 595 599 596 if ( ! $result ) 600 597 { 601 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );602 mail_to_user( "fail", "Bad query\n$query\n" . mysql _error( $us3_link ) );598 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 599 mail_to_user( "fail", "Bad query\n$query\n" . mysqli_error( $us3_link ) ); 603 600 return( -1 ); 604 601 } … … 615 612 "WHERE mrecsID=$mrecsID"; 616 613 617 $result = mysql _query( $query, $us3_link);614 $result = mysqli_query( $us3_link, $query ); 618 615 619 616 if ( ! $result ) 620 617 { 621 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );622 mail_to_user( "fail", "Bad query\n$query\n" . mysql _error( $us3_link ) );618 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 619 mail_to_user( "fail", "Bad query\n$query\n" . mysqli_error( $us3_link ) ); 623 620 return( -1 ); 624 621 } … … 633 630 $query = "SELECT HPCAnalysisRequestGUID FROM HPCAnalysisRequest " . 634 631 "WHERE HPCAnalysisRequestID = $requestID "; 635 $result = mysql _query( $query, $us3_link);632 $result = mysqli_query( $us3_link, $query ); 636 633 637 634 if ( ! $result ) 638 635 { 639 write_log( "$me: Bad query:\n$query\n" . mysql _error( $us3_link ) );636 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $us3_link ) ); 640 637 } 641 638 642 // list( $requestGUID ) = mysql _fetch_array( $result );639 // list( $requestGUID ) = mysqli_fetch_array( $result ); 643 640 // 644 641 // chdir( "$submit_dir/$requestGUID" ); … … 651 648 // exec( "rm -rf $gfacID" ); 652 649 653 mysql _close( $us3_link );650 mysqli_close( $us3_link ); 654 651 655 652 ///////// … … 725 722 { 726 723 $limshost = gethostname(); 727 if ( ! preg_match( "/\./", $limshost ) ) 724 if ( preg_match( "/scyld/", $limshost ) ) 725 $limshost = 'alamo.uthscsa.edu'; 726 else if ( ! preg_match( "/\./", $limshost ) ) 728 727 $limshost = $limshost . $org_domain; 729 728 } … … 870 869 global $me; 871 870 global $db; 871 global $dbhost; 872 872 global $status; 873 873 $is_us3iab = preg_match( "/us3iab/", $cluster ); 874 874 $is_jetstr = preg_match( "/jetstream/", $cluster ); 875 876 // Figure out remote directory 875 $limshost = $dbhost; 876 $stderr = ''; 877 $stdout = ''; 878 $tarfile = ''; 879 880 if ( $limshost == 'localhost' ) 881 { // If DB host is local host, get full LIMS host name 882 $limshost = gethostname(); 883 if ( preg_match( "/scyld/", $limshost ) ) 884 $limshost = 'alamo.uthscsa.edu'; 885 else if ( ! preg_match( "/\./", $limshost ) ) 886 $limshost = $limshost . $org_domain; 887 } 888 889 if ( preg_match( "/alamo/", $limshost ) && 890 preg_match( "/alamo/", $cluster ) ) 891 { // If both LIMS and cluster are alamo, set up local transfers 892 $is_us3iab = 1; 893 if ( ! preg_match( "/\/local/", $work_remote ) ) 894 $work_remote = $work_remote . "/local"; 895 } 896 897 // Figure out job's remote (or local) work directory 877 898 $remoteDir = sprintf( "$work_remote/$db-%06d", $requestID ); 878 899 //write_log( "$me: is_us3iab=$is_us3iab remoteDir=$remoteDir" ); … … 891 912 $lworkdir = "/N/us3_cluster/work/local"; 892 913 } 893 $cmd = "ssh us3@$clushost 'ls -d $lworkdir' 2 /dev/null";914 $cmd = "ssh us3@$clushost 'ls -d $lworkdir' 2>/dev/null"; 894 915 exec( $cmd, $output, $stat ); 895 916 $work_remote = $output[ 0 ]; … … 934 955 } 935 956 else 936 { 957 { // Is US3IAB or alamo-to-alamo, so just change to local work directory 937 958 $pwd = chdir( "$remoteDir" ); 938 959 write_log( "$me: IS US3IAB: pwd=$pwd $remoteDir"); … … 942 963 // Write the files to gfacDB 943 964 965 $secwait = 10; 966 $num_try = 0; 967 while ( ! file_exists( "stderr" ) && $num_try < 3 ) 968 { // Do waits and retries to let stderr appear 969 sleep( $secwait ); 970 $num_try++; 971 $secwait *= 2; 972 write_log( "$me: not-exist-stderr: num_try=$num_try" ); 973 } 974 975 $lense = 0; 944 976 if ( file_exists( "stderr" ) ) 945 { // Filter stderr to not have libnnls debug lines 946 // exec( "mv stderr stderr+nnls", $output, $stat ); 947 // exec( "grep -vi nnls stderr+nnls >stderr", $output, $stat ); 977 { 978 $lense = filesize( "stderr" ); 979 if ( $lense > 1000000 ) 980 { // Replace exceptionally large stderr with smaller version 981 exec( "mv stderr stderr-orig", $output, $stat ); 982 exec( "head -n 5000 stderr-orig >stderr-h", $output, $stat ); 983 exec( "tail -n 5000 stderr-orig >stderr-t", $output, $stat ); 984 exec( "cat stderr-h stderr-t >stderr", $output, $stat ); 985 } 948 986 $stderr = file_get_contents( "stderr" ); 949 987 } 950 988 else 989 { 951 990 $stderr = ""; 991 } 992 952 993 if ( file_exists( "stdout" ) ) $stdout = file_get_contents( "stdout" ); 994 953 995 $fn1_tarfile = "analysis-results.tar"; 954 996 $fn2_tarfile = "output/" . $fn1_tarfile; … … 958 1000 $tarfile = file_get_contents( $fn2_tarfile ); 959 1001 960 $lense = strlen( $stderr ); 961 if ( $lense > 1000000 ) 962 { // Replace exceptionally large stderr with smaller version 963 exec( "mv stderr stderr-orig", $output, $stat ); 964 exec( "head -n 5000 stderr-orig >stderr-h", $output, $stat ); 965 exec( "tail -n 5000 stderr-orig >stderr-t", $output, $stat ); 966 exec( "cat stderr-h stderr-t >stderr", $output, $stat ); 967 $stderr = file_get_contents( "stderr" ); 968 } 969 $lent = strlen( $tarfile ); 970 write_log( "$me: tarfile size: $lent"); 1002 // $lense = strlen( $stderr ); 1003 // if ( $lense > 1000000 ) 1004 // { // Replace exceptionally large stderr with smaller version 1005 // exec( "mv stderr stderr-orig", $output, $stat ); 1006 // exec( "head -n 5000 stderr-orig >stderr-h", $output, $stat ); 1007 // exec( "tail -n 5000 stderr-orig >stderr-t", $output, $stat ); 1008 // exec( "cat stderr-h stderr-t >stderr", $output, $stat ); 1009 // $stderr = file_get_contents( "stderr" ); 1010 // } 971 1011 $lene = strlen( $stderr ); 972 1012 write_log( "$me: stderr size: $lene (was $lense)"); 973 1013 $leno = strlen( $stdout ); 974 1014 write_log( "$me: stdout size: $leno"); 975 $estarf=mysql_real_escape_string($tarfile,$gfac_link); 1015 $lent = strlen( $tarfile ); 1016 write_log( "$me: tarfile size: $lent"); 1017 $esstde = mysqli_real_escape_string( $gfac_link, $stderr ); 1018 $esstdo = mysqli_real_escape_string( $gfac_link, $stdout ); 1019 $estarf = mysqli_real_escape_string( $gfac_link, $tarfile ); 1020 $lene = strlen($esstde); 1021 write_log( "$me: es-stderr size: $lene"); 1022 $leno = strlen($esstdo); 1023 write_log( "$me: es-stdout size: $leno"); 976 1024 $lenf = strlen($estarf); 977 write_log( "$me: es-tarfile size: $lenf"); 978 $esstdo=mysql_real_escape_string($stdout,$gfac_link); 979 $leno = strlen($esstdo); 980 write_log( "$me: es-stdout size: $leno"); 981 $esstde=mysql_real_escape_string($stderr,$gfac_link); 982 $lene = strlen($esstde); 983 write_log( "$me: es-stderr size: $lene"); 1025 write_log( "$me: es-tarfile size: $lenf"); 984 1026 $query = "UPDATE analysis SET " . 985 "stderr='" . mysql_real_escape_string( $stderr, $gfac_link ). "'," .986 "stdout='" . mysql_real_escape_string( $stdout, $gfac_link ). "'," .987 "tarfile='" . mysql_real_escape_string( $tarfile, $gfac_link ). "'";988 989 $result = mysql _query( $query, $gfac_link);990 991 if ( ! $result ) 992 { 993 write_log( "$me: Bad query:\n$query\n" . mysql _error( $gfac_link ) );1027 "stderr='" . $esstde . "'," . 1028 "stdout='" . $esstdo . "'," . 1029 "tarfile='" . $estarf . "'"; 1030 1031 $result = mysqli_query( $gfac_link, $query ); 1032 1033 if ( ! $result ) 1034 { 1035 write_log( "$me: Bad query:\n$query\n" . mysqli_error( $gfac_link ) ); 994 1036 echo "Bad query\n"; 995 1037 return( -1 );
Note:
See TracChangeset
for help on using the changeset viewer.