IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 17, 2007, 10:55:24 AM (19 years ago)
Author:
jhoblitt
Message:

add detool -revertdetrunsummary

File:
1 edited

Legend:

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

    r14268 r14269  
    8686static bool adddetrunsummaryMode(pxConfig *config);
    8787static bool detrunsummaryMode(pxConfig *config);
     88static bool revertdetrunsummaryMode(pxConfig *config);
    8889static bool updatedetrunMode(pxConfig *config);
    8990static bool rerunMode(pxConfig *config);
     
    177178        MODECASE(DETTOOL_MODE_ADDDETRUNSUMMARY, adddetrunsummaryMode);
    178179        MODECASE(DETTOOL_MODE_DETRUNSUMMARY,    detrunsummaryMode);
     180        MODECASE(DETTOOL_MODE_REVERTDETRUNSUMMARY, revertdetrunsummaryMode);
    179181        MODECASE(DETTOOL_MODE_UPDATEDETRUN,     updatedetrunMode);
    180182        MODECASE(DETTOOL_MODE_RERUN,            rerunMode);
     
    59975999    psFree(output);
    59986000
     6001    // XXX this logic does not deal with the case of -code being set
    59996002    if (again) {
    60006003        if (!startNewIteration(config, (psS64)atoll(det_id))) {
     
    61776180    return true;
    61786181}
     6182
     6183
     6184static bool revertdetrunsummaryMode(pxConfig *config)
     6185{
     6186    PS_ASSERT_PTR_NON_NULL(config, false);
     6187
     6188    psString query = pxDataGet("dettool_revertdetrunsummary.sql");
     6189    if (!query) {
     6190        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     6191        return false;
     6192    }
     6193
     6194    if (config->where) {
     6195        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "detRunSummary");
     6196        psStringAppend(&query, " AND %s", whereClause);
     6197        psFree(whereClause);
     6198    }
     6199
     6200    if (!p_psDBRunQuery(config->dbh, query)) {
     6201        psError(PS_ERR_UNKNOWN, false, "database error");
     6202        psFree(query);
     6203        return false;
     6204    }
     6205    psFree(query);
     6206
     6207    if (psDBAffectedRows(config->dbh) < 1) {
     6208        psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row");
     6209        return false;
     6210    }
     6211
     6212    return true;
     6213}
     6214
    61796215
    61806216static bool updatedetrunMode(pxConfig *config)
Note: See TracChangeset for help on using the changeset viewer.