IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/ippTools/src/warptool.c

    r26981 r27517  
    383383    PXOPT_COPY_S64(config->args, where, "-warp_id",   "warpRun.warp_id",   "==");
    384384    PXOPT_COPY_STR(config->args, where, "-reduction", "warpRun.reduction", "==");
    385     PXOPT_COPY_STR(config->args, where, "-label",     "warpRun.label",     "==");
    386385    PXOPT_COPY_STR(config->args, where, "-state",     "warpRun.state",     "==");
    387     PXOPT_COPY_STR(config->args, where, "-data_group","warpRun.data_group",     "==");
    388     PXOPT_COPY_STR(config->args, where, "-dist_group","warpRun.dist_group",     "==");
     386    PXOPT_COPY_STR(config->args, where, "-data_group","warpRun.data_group","==");
     387    PXOPT_COPY_STR(config->args, where, "-dist_group","warpRun.dist_group","==");
     388    pxAddLabelSearchArgs(config,  where, "-label",    "warpRun.label",     "==");
     389
     390    PXOPT_COPY_TIME(config->args, where, "-registered_begin", "warpRun.registered",  ">=");
     391    PXOPT_COPY_TIME(config->args, where, "-registered_end",   "warpRun.registered",  "<");
     392
     393    PXOPT_LOOKUP_BOOL(destreaked, config->args, "-destreaked", false);
     394    if (destreaked) {
     395        psMetadataAddS64(where, PS_LIST_TAIL, "warpRun.magicked", PS_META_DUPLICATE_OK, ">", 0);
     396    }
    389397
    390398    if (!psListLength(where->list)) {
     
    394402    }
    395403
    396     psString query = psStringCopy("UPDATE warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
     404    psString query = psStringCopy("UPDATE warpRun JOIN warpSkyfile USING(warp_id) JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");
    397405
    398406    // pxUpdateRun gets parameters from config->args and updates
    399     bool result = pxUpdateRun(config, where, &query, "warpRun", true);
     407    bool result = pxUpdateRun(config, where, &query, "warpRun", "warp_id", "warpSkyfile", true);
    400408
    401409    psFree(query);
     
    899907    }
    900908
     909    psString whereStr = psStringCopy("");
    901910    if (psListLength(where->list)) {
    902911        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    903         psStringAppend(&query, " AND %s", whereClause);
     912        psStringAppend(&whereStr, "\n AND %s", whereClause);
    904913        psFree(whereClause);
    905914    }
     
    913922    }
    914923
    915     if (!p_psDBRunQuery(config->dbh, query)) {
     924#ifdef TWO_WHERES
     925    if (!p_psDBRunQueryF(config->dbh, query, whereStr, whereStr)) {
    916926        psError(PS_ERR_UNKNOWN, false, "database error");
    917927        psFree(query);
    918928        return false;
    919929    }
     930#else
     931    if (!p_psDBRunQueryF(config->dbh, query, whereStr)) {
     932        psError(PS_ERR_UNKNOWN, false, "database error");
     933        psFree(query);
     934        return false;
     935    }
     936#endif
     937    psFree(whereStr);
    920938    psFree(query);
    921939
Note: See TracChangeset for help on using the changeset viewer.