IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24460 for trunk/ippTools/src


Ignore:
Timestamp:
Jun 17, 2009, 10:04:29 AM (17 years ago)
Author:
bills
Message:

fix some problems with disttool -revertrun

File:
1 edited

Legend:

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

    r24425 r24460  
    488488    PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
    489489    PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    490     PXOPT_COPY_S16(config->args, where, "-fault", "fault", "==");
     490
     491    // we need to disambiguate fault so make a copy of the where list before adding fault
     492    psMetadata *whereComponent = psMetadataCopy(NULL, where);
     493    PXOPT_COPY_S16(config->args, where,  "-fault", "distRun.fault", "==");
     494    PXOPT_COPY_S16(config->args, whereComponent, "-fault", "distComponent.fault", "==");
    491495
    492496    // It might be useful to be able to query by the parameters of the underlying runs
     
    533537
    534538        numUpdated = psDBAffectedRows(config->dbh);
    535 
    536 #ifdef notdef
    537         // don't need this. distRun.state may still be in 'new' state
    538         if (numUpdated < 1) {
    539             psError(PS_ERR_UNKNOWN, false, "should have affected at least 1 row");
    540             if (!psDBRollback(config->dbh)) {
    541                 psError(PS_ERR_UNKNOWN, false, "database error");
    542             }
    543             return false;
    544         }
    545 #endif
    546539    }
    547540
     
    560553        }
    561554
    562         if (psListLength(where->list)) {
    563             psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     555        if (psListLength(whereComponent->list)) {
     556            psString whereClause = psDBGenerateWhereConditionSQL(whereComponent, NULL);
    564557            psStringAppend(&query, " AND %s", whereClause);
    565558            psFree(whereClause);
     
    582575
    583576    psFree(where);
     577    psFree(whereComponent);
    584578
    585579    if (!psDBCommit(config->dbh)) {
Note: See TracChangeset for help on using the changeset viewer.