IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 4:00:36 PM (16 years ago)
Author:
Paul Price
Message:

Fix destreaking bug: magicdstool -getskycells assumed the mapping between skycells and chips is identical for both the inputs to a diff. Broke the query out into separate cases.

File:
1 edited

Legend:

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

    r27452 r27518  
    11351135
    11361136    psMetadata *where = psMetadataAlloc();
     1137    PXOPT_COPY_S64(config->args, where, "-magic_ds_id", "magicDSRun.magic_ds_id", "==");
    11371138    PXOPT_COPY_STR(config->args, where, "-class_id",    "warpSkyCellMap.class_id", "==");
    11381139    PXOPT_COPY_STR(config->args, where, "-skycell_id",  "warpSkyCellMap.skycell_id", "==");
     
    11461147    }
    11471148
     1149    psString whereClause = NULL;
    11481150    if (psListLength(where->list)) {
    1149         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    1150         psStringAppend(&query, " AND %s", whereClause);
    1151         psFree(whereClause);
     1151        whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1152        psStringPrepend(&whereClause, "\n");
    11521153    }
    11531154    psFree(where);
    11541155
    1155     if (!p_psDBRunQueryF(config->dbh, query, magic_ds_id)) {
     1156    if (!p_psDBRunQueryF(config->dbh, query, whereClause, whereClause)) {
    11561157        psError(PS_ERR_UNKNOWN, false, "database error");
    11571158        psFree(query);
Note: See TracChangeset for help on using the changeset viewer.