Changeset 19371 for trunk/ippTools/src/flatcorr.c
- Timestamp:
- Sep 4, 2008, 2:23:50 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/flatcorr.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/flatcorr.c
r19325 r19371 131 131 132 132 if (where && psListLength(where->list)) { 133 psString whereClause = psDBGenerateWhereConditionSQL(where, "rawExp");133 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 134 134 psStringAppend(&query, " AND %s", whereClause); 135 135 psFree(whereClause); … … 177 177 178 178 // create a new flatcorrRun 179 if (!flatcorrRunInsert(config->dbh, 179 if (!flatcorrRunInsert( 180 config->dbh, 180 181 0, // corr_id 181 182 dvodb, … … 184 185 workdir, 185 186 label, 186 NULL, // stats187 187 reduction, 188 region 188 region, 189 NULL, 190 0 189 191 )) { 190 192 if (!psDBRollback(config->dbh)) { … … 285 287 workdir, 286 288 label, 287 NULL, // stats288 289 reduction, 289 region 290 region, 291 NULL, // hostname 292 0 // fault 290 293 ); 291 294 … … 549 552 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 550 553 PXOPT_LOOKUP_BOOL(limit, config->args, "-limit", false); 551 552 char *query = psStringCopy ("SELECT * FROM chipProcessedImfile WHERE chip_id = %" PRId64); 554 555 psMetadata *where = psMetadataAlloc(); 556 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipProcessedImfile.chip_id", "=="); 557 558 psString query = pxDataGet("flatcorr_inputimfile.sql"); 559 if (!query) { 560 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 561 return false; 562 } 563 564 if (where && psListLength(where->list)) { 565 psString whereClause = psDBGenerateWhereSQL(where, NULL); 566 psStringAppend(&query, " %s", whereClause); 567 psFree(whereClause); 568 } 569 psFree(where); 553 570 554 571 // treat limit == 0 as "no limit" … … 591 608 592 609 PXOPT_LOOKUP_S64(corr_id, config->args, "-corr_id", true, false); 593 594 if (!setflatcorrRunState(config, corr_id, "full")) { 595 if (!psDBRollback(config->dbh)) { 596 psError(PS_ERR_UNKNOWN, false, "database error"); 597 } 598 psError(PS_ERR_UNKNOWN, false, "failed to set run state"); 610 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 611 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 612 613 char *query = "UPDATE flatcorrRun SET state = 'full', hostname = '%s', fault = '%hd' WHERE corr_id = %" PRId64; 614 615 if (!p_psDBRunQuery(config->dbh, query, hostname, code, corr_id)) { 616 psError(PS_ERR_UNKNOWN, false, "failed to change state for corr_id %" PRId64, corr_id); 599 617 return false; 600 618 } … … 636 654 637 655 char *query = "UPDATE flatcorrRun SET state = '%s' WHERE corr_id = %" PRId64; 656 638 657 if (!p_psDBRunQuery(config->dbh, query, state, corr_id)) { 639 psError(PS_ERR_UNKNOWN, false, 640 "failed to change state for corr_id %" PRId64, corr_id); 641 return false; 642 } 643 644 return true; 645 } 646 647 658 psError(PS_ERR_UNKNOWN, false, "failed to change state for corr_id %" PRId64, corr_id); 659 return false; 660 } 661 662 return true; 663 }
Note:
See TracChangeset
for help on using the changeset viewer.
