IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 11, 2007, 3:01:27 PM (19 years ago)
Author:
jhoblitt
Message:

properly constraint camtool -addprocessexp sanity checking SQL

File:
1 edited

Legend:

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

    r14100 r14147  
    590590    }
    591591
    592     if (!p_psDBRunQuery(config->dbh, query, cam_id)) {
     592    {
     593        // build a query to search by cam_id
     594        psMetadata *where = psMetadataAlloc();
     595        if (cam_id) {
     596            if (!psMetadataAddS64(where, PS_LIST_TAIL, "cam_id", 0, "==", (psS64)atoll(cam_id))) {
     597                psError(PS_ERR_UNKNOWN, false, "failed to add item cam_id");
     598                psFree(where);
     599                psFree(query);
     600                return false;
     601            }
     602        }
     603
     604        psString whereClaus = psDBGenerateWhereSQL(where, NULL);
     605        psFree(where);
     606        if (whereClaus) {
     607            psStringAppend(&query, " %s", whereClaus);
     608            psFree(whereClaus);
     609        }
     610
     611    }
     612
     613    if (!p_psDBRunQuery(config->dbh, query)) {
    593614        psError(PS_ERR_UNKNOWN, false, "database error");
    594615        psFree(query);
Note: See TracChangeset for help on using the changeset viewer.