Changeset 24736 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Jul 9, 2009, 1:12:40 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r24664 r24736 247 247 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 248 248 psFree(output); 249 psFree(where);249 psFree(where); 250 250 return false; 251 251 } … … 379 379 psStringSubstitute(&thisInsert, skycell_id, "@SKYCELL_ID@"); 380 380 381 if (randomLimit > 0) {382 psString limString = NULL;383 psStringAppend(&limString, "%d", randomLimit);384 psStringSubstitute(&thisInsert, limString, "@RANDOM_LIMIT@");385 psFree(limString);386 }381 if (randomLimit > 0) { 382 psString limString = NULL; 383 psStringAppend(&limString, "%d", randomLimit); 384 psStringSubstitute(&thisInsert, limString, "@RANDOM_LIMIT@"); 385 psFree(limString); 386 } 387 387 388 388 // XXX this insert uses a select to generate the list of warp_ids for the stack, … … 404 404 405 405 # if (0) 406 {407 psArray *output = p_psDBFetchResult(config->dbh);408 if (!output) {409 psErrorCode err = psErrorCodeLast();410 switch (err) {411 case PS_ERR_DB_CLIENT:412 psError(PXTOOLS_ERR_SYS, false, "database error");413 case PS_ERR_DB_SERVER:414 psError(PXTOOLS_ERR_PROG, false, "database error");415 default:416 psError(PXTOOLS_ERR_PROG, false, "unknown error");417 }418 psFree(where);419 return false;420 }421 if (!psArrayLength(output)) {422 psWarning("stacktool (definebyquery, insert): no rows found");423 psFree(output);424 psFree(where);425 return true;426 }427 // negative simple so the default is true428 if (!ippdbPrintMetadatas(stdout, output, "stackSkycells", !simple)) {429 psError(PS_ERR_UNKNOWN, false, "failed to print array");430 psFree(output);431 psFree(where);432 return false;433 }434 psFree(output);435 psFree(where);436 return true;437 }406 { 407 psArray *output = p_psDBFetchResult(config->dbh); 408 if (!output) { 409 psErrorCode err = psErrorCodeLast(); 410 switch (err) { 411 case PS_ERR_DB_CLIENT: 412 psError(PXTOOLS_ERR_SYS, false, "database error"); 413 case PS_ERR_DB_SERVER: 414 psError(PXTOOLS_ERR_PROG, false, "database error"); 415 default: 416 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 417 } 418 psFree(where); 419 return false; 420 } 421 if (!psArrayLength(output)) { 422 psWarning("stacktool (definebyquery, insert): no rows found"); 423 psFree(output); 424 psFree(where); 425 return true; 426 } 427 // negative simple so the default is true 428 if (!ippdbPrintMetadatas(stdout, output, "stackSkycells", !simple)) { 429 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 430 psFree(output); 431 psFree(where); 432 return false; 433 } 434 psFree(output); 435 psFree(where); 436 return true; 437 } 438 438 # endif 439 439 … … 828 828 } 829 829 830 if (!setstackRunState(config, stack_id, "full")) { 831 if (!psDBRollback(config->dbh)) { 832 psError(PS_ERR_UNKNOWN, false, "database error"); 833 } 834 psError(PS_ERR_UNKNOWN, false, "failed to change stackRun's state"); 835 return false; 830 if (fault == 0) { 831 if (!setstackRunState(config, stack_id, "full")) { 832 if (!psDBRollback(config->dbh)) { 833 psError(PS_ERR_UNKNOWN, false, "database error"); 834 } 835 psError(PS_ERR_UNKNOWN, false, "failed to change stackRun's state"); 836 return false; 837 } 836 838 } 837 839
Note:
See TracChangeset
for help on using the changeset viewer.
