Changeset 17188 for trunk/ippTools/src/chiptool.c
- Timestamp:
- Mar 28, 2008, 2:46:04 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r17186 r17188 355 355 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 356 356 357 // XXX does this need to be constrained so that it won't return any results 358 // if a match chipPendingExp hasn't been registered? 357 psMetadata *where = psMetadataAlloc(); 358 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 359 // convert chip_id into a psS64 360 if (chip_id) { 361 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) { 362 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 363 psFree(where); 364 return false; 365 } 366 } 367 368 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 369 // convert exp_id into a psS64 370 if (exp_id) { 371 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 372 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 373 psFree(where); 374 return false; 375 } 376 } 377 378 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 379 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); 380 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "=="); 381 359 382 psString query = pxDataGet("chiptool_pendingimfile.sql"); 360 383 if (!query) { … … 363 386 } 364 387 365 if ( config->where) {366 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "chipInputImfile");388 if (where && psListLength(where->list)) { 389 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 367 390 psStringAppend(&query, " AND %s", whereClause); 368 391 psFree(whereClause); 369 392 } 393 psFree(where); 370 394 371 395 // treat limit == 0 as "no limit" … … 529 553 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false); 530 554 531 // XXX does this need to be constrained so that it won't return any results 532 // if a match chipPendingExp hasn't been registered? 555 psMetadata *where = psMetadataAlloc(); 556 PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", false, false); 557 // convert chip_id into a psS64 558 if (chip_id) { 559 if (!psMetadataAddS64(where, PS_LIST_TAIL, "chipRun.chip_id", 0, "==", (psS64)atoll(chip_id))) { 560 psError(PS_ERR_UNKNOWN, false, "failed to add item chip_id"); 561 psFree(where); 562 return false; 563 } 564 } 565 566 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 567 // convert exp_id into a psS64 568 if (exp_id) { 569 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 570 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 571 psFree(where); 572 return false; 573 } 574 } 575 576 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 577 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); 578 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "=="); 579 533 580 psString query = pxDataGet("chiptool_processedimfile.sql"); 534 581 if (!query) { … … 537 584 } 538 585 539 if ( config->where) {540 psString whereClause = psDBGenerateWhereConditionSQL( config->where, "chipProcessedImfile");586 if (where && psListLength(where->list)) { 587 psString whereClause = psDBGenerateWhereConditionSQL(where, "chipProcessedImfile"); 541 588 psStringAppend(&query, " AND %s", whereClause); 542 589 psFree(whereClause); 543 590 } 591 psFree(where); 544 592 545 593 if (faulted) {
Note:
See TracChangeset
for help on using the changeset viewer.
