IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8074 for trunk/ippTools/src


Ignore:
Timestamp:
Aug 2, 2006, 11:22:05 AM (20 years ago)
Author:
jhoblitt
Message:

change p2searchPendingExp() to search only based on exp_id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/p2searchPendingFrames.c

    r8062 r8074  
    6262    PS_ASSERT_PTR_NON_NULL(config, NULL);
    6363
    64     psArray *exps = p2PendingExpSelectRowObjects(config->dbh,
    65         config->where,
    66         MAX_ROWS);
     64    // exp_id is optional
     65    bool status = false;
     66    psString exp_id = psMetadataLookupStr(&status, config->args, "-exp_id");
     67    if (!status) {
     68        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_id");
     69        return false;
     70    }
     71
     72    // search only based on exp_id -- either they specified it or not
     73    psMetadata *where = NULL;
     74    if (exp_id) {
     75        where = psMetadataAlloc();
     76        if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", exp_id)) {
     77            psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     78            psFree(where);
     79            return false;
     80        }
     81    }
     82    psArray *exps = p2PendingExpSelectRowObjects(config->dbh, where, MAX_ROWS);
     83    psFree(where);
    6784    if (!exps) {
    6885        psError(PS_ERR_UNKNOWN, false, "no p2PendingExp rows found");
Note: See TracChangeset for help on using the changeset viewer.