Changeset 10771 for trunk/ippTools/src/warptool.c
- Timestamp:
- Dec 15, 2006, 5:37:28 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r10770 r10771 507 507 PS_ASSERT_PTR_NON_NULL(config, NULL); 508 508 509 psString query = psStringCopy( 510 " SELECT DISTINCT" 511 " p4InputImfile.p4_id," 512 " p2ProcessedImfile.*" 513 " FROM p4Run" 514 " JOIN p4WarpedImfile" 515 " USING(p4_id)" 516 " LEFT JOIN p4StackedImfile" 517 " USING(p4_id, class_id)" 518 " WHERE" 519 " p4Run.state = 'run'" 520 " AND p4StackedImfile.p4_id IS NULL" 521 " AND p4Stackedmfile.class_id IS NULL" 522 ); 523 524 if (config->where) { 525 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p4WarpedImfile"); 526 psStringAppend(&query, " AND %s", whereClause); 527 psFree(whereClause); 528 } 529 530 if (!p_psDBRunQuery(config->dbh, query)) { 531 psError(PS_ERR_UNKNOWN, false, "database error"); 532 psFree(query); 533 return false; 534 } 535 psFree(query); 536 537 psArray *output = p_psDBFetchResult(config->dbh); 538 if (!output) { 539 psError(PS_ERR_UNKNOWN, false, "database error"); 540 return false; 541 } 542 if (!psArrayLength(output)) { 543 // XXX check psError here 544 psError(PS_ERR_UNKNOWN, false, "no p4WarpedImfile rows found"); 545 psFree(output); 546 return true; 547 } 548 549 bool simple = false; 550 { 551 bool status = false; 552 simple = psMetadataLookupBool(&status, config->args, "-simple"); 553 if (!status) { 554 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 555 return false; 556 } 557 } 558 559 // negative simple so the default is true 560 if (!ippdbPrintMetadatas(stdout, output, "p4WarpedImfile", !simple)) { 561 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 562 psFree(output); 563 return false; 564 } 565 566 psFree(output); 567 509 568 return true; 510 569 }
Note:
See TracChangeset
for help on using the changeset viewer.
