Changeset 14082 for trunk/ippTools/src/dettool.c
- Timestamp:
- Jul 9, 2007, 11:04:02 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r14079 r14082 5495 5495 PS_ASSERT_PTR_NON_NULL(config, false); 5496 5496 5497 // select detRun.det_id 5498 // select detRun.iteration 5499 // by: 5500 // find the current iteration bassed on det_id 5501 // find all exp_ids in the current det_id/iteration from detInputExp 5502 // find all exp_ids in the current det_id/iteration from detResidExp 5503 // compare the counts of exp_ids 5497 // required 5498 bool status = false; 5499 psString det_id = psMetadataLookupStr(&status, config->args, "-det_id"); 5500 if (!status) { 5501 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id"); 5502 return false; 5503 } 5504 if (!det_id) { 5505 psError(PS_ERR_UNKNOWN, true, "-det_id is required"); 5506 return false; 5507 } 5508 5509 // optional 5510 bool again = psMetadataLookupBool(&status, config->args, "-again"); 5511 if (!status) { 5512 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -again"); 5513 return false; 5514 } 5504 5515 5505 5516 psString query = pxDataGet("dettool_find_completed_runs.sql"); … … 5513 5524 psMetadata *where = psMetadataAlloc(); 5514 5525 bool status = false; 5515 psString det_id = psMetadataLookupStr(&status, config->args, "-det_id");5516 if (!status) {5517 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -det_id");5518 psFree(where);5519 psFree(query);5520 return false;5521 }5522 5526 if (det_id) { 5523 if (!psMetadataAddS tr(where, PS_LIST_TAIL, "det_id", 0, "==", det_id)) {5527 if (!psMetadataAddS64(where, PS_LIST_TAIL, "det_id", 0, "==", (psS64)atoll(det_id))) { 5524 5528 psError(PS_ERR_UNKNOWN, false, "failed to add item det_id"); 5525 5529 psFree(where); … … 5603 5607 5604 5608 psFree(output); 5609 5610 if (again) { 5611 if (!startNewIteration(config, (psS64)atoll(det_id))) { 5612 if (!psDBRollback(config->dbh)) { 5613 psError(PS_ERR_UNKNOWN, false, "database error"); 5614 } 5615 psError(PS_ERR_UNKNOWN, false, "failed to start new iteration"); 5616 return false; 5617 } 5618 } else { 5619 // set detRun.state to stop 5620 if (!setDetRunState(config, (psS64)atoll(det_id), "stop")) { 5621 if (!psDBRollback(config->dbh)) { 5622 psError(PS_ERR_UNKNOWN, false, "database error"); 5623 } 5624 psError(PS_ERR_UNKNOWN, false, "failed to set detRun.state"); 5625 return false; 5626 } 5627 } 5605 5628 5606 5629 if (!psDBCommit(config->dbh)) { … … 5831 5854 // in an inconsistent UPDATE below. I added this AND clause 5832 5855 // though there may be a cleaner method (EAM 2006.10.08) 5833 psStringAppend(&query, " WHERE det Run.det_id = %" PRId64 , det_id);5856 psStringAppend(&query, " WHERE det_id = %" PRId64 , det_id); 5834 5857 5835 5858 if (!p_psDBRunQuery(config->dbh, query)) {
Note:
See TracChangeset
for help on using the changeset viewer.
