Changeset 28259 for trunk/ippTools/src/disttool.c
- Timestamp:
- Jun 8, 2010, 2:37:19 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/disttool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/disttool.c
r27542 r28259 470 470 PXOPT_COPY_STR(config->args, where, "-data_group", "distRun.data_group", "LIKE"); 471 471 PXOPT_COPY_STR(config->args, where, "-dist_group", "distTarget.dist_group", "=="); 472 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 472 PXOPT_COPY_TIME(config->args, where, "-time_stamp_begin", "distRun.time_stamp", ">="); 473 PXOPT_COPY_TIME(config->args, where, "-time_stamp_end", "distRun.time_stamp", "<="); 474 475 PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false); 476 PXOPT_LOOKUP_BOOL(full, config->args, "-full", false); 477 if (clean && full) { 478 psFree(where); 479 psError(PXTOOLS_ERR_CONFIG, true, "-clean and -full are contradictory parameters"); 480 return false; 481 } 473 482 474 483 if (!psListLength(where->list)) { … … 491 500 } 492 501 502 psString extraWhere = NULL; 493 503 psString query = psStringCopy("UPDATE distRun join distTarget using(target_id, stage) SET distRun.time_stamp = UTC_TIMESTAMP()"); 494 504 … … 498 508 if (state) { 499 509 psStringAppend(&query, " , distRun.state = '%s'", state); 510 if (!strcmp(state, "goto_cleaned")) { 511 // don't queue for clean up if run has already already cleaned 512 psStringAppend(&extraWhere, " AND (distRun.state != 'cleaned' AND distRun.state != 'goto_cleaned')"); 513 } 500 514 } 501 515 … … 521 535 psFree(whereClause); 522 536 psFree(where); 537 538 if (extraWhere) { 539 psStringAppend(&query, extraWhere); 540 } 541 if (clean) { 542 psStringAppend(&query, " AND (distRun.clean)"); 543 } else if (full) { 544 psStringAppend(&query, " AND (!distRun.clean)"); 545 } 523 546 524 547 if (!p_psDBRunQuery(config->dbh, query)) {
Note:
See TracChangeset
for help on using the changeset viewer.
