IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 9, 2006, 1:59:08 PM (20 years ago)
Author:
jhoblitt
Message:

remove the "position" auto index field from all ippdb generated tables.
change all use of detRun.position to be detRun.det_id

File:
1 edited

Legend:

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

    r9417 r9425  
    6565static bool rerunMode(pxConfig *config);
    6666
    67 static bool mapPositionToDetRun(psArray *mds);
     67static bool convertDetIdToStr(psArray *mds);
    6868static detNormalizedStatImfileRow *detStackedToDetNormalizedStatImfile(pxConfig *config, detStackedImfileRow *stackedImfile);
    6969static  detNormalizedImfileRow *detNormalizedStatToDetNormalizedmfile(pxConfig *config, detNormalizedStatImfileRow *statImfile);
     
    281281    }
    282282
    283     // grab the 'position' column's value as the new det_id
    284283    // the first iteration is always 0
    285284    // XXX the camera name is set from the first inputExp
    286     detRunInsert(config->dbh, 0, det_type, "run");
     285    // XXX det_id
     286    detRunInsert(config->dbh, 0, 0, det_type, "run");
    287287    long det_id = psDBLastInsertID(config->dbh);
    288288
     
    333333    {
    334334        psMetadata *where = psMetadataAlloc();
    335         // map det_id -> position
    336         psMetadataAddS32(where, PS_LIST_TAIL, "position", 0, "==", det_id);
     335        psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
    337336        detRuns = psDBSelectRows(config->dbh, "detRun", where, 0);
    338337        psFree(where);
     
    348347    }
    349348
    350     // map position -> det_id
    351     if (!mapPositionToDetRun(detRuns)) {
    352         psError(PS_ERR_UNKNOWN, false, "failed to map position -> det_id");
     349    // convert det_id to a str externally
     350    if (!convertDetIdToStr(detRuns)) {
     351        psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    353352        psFree(detRuns);
    354353        return false;
     
    366365}
    367366
    368 static bool mapPositionToDetRun(psArray *mds)
     367// This function is used to convert the det_id from an int, as it is used
     368// internally, to be a string for external use.  The rational being that we may
     369// want to change how det_id is generated in the future and don't want to
     370// external programs to become depending on this value being an int.
     371static bool convertDetIdToStr(psArray *mds)
    369372{
    370373    PS_ASSERT_PTR_NON_NULL(mds, false);
    371374
    372375    for (long i = 0; i < psArrayLength(mds); i++) {
     376        psMetadata *md = mds->data[i];
    373377        bool status = false;
    374         psS32 position = psMetadataLookupS32(&status, mds->data[i], "position");
     378        psS32 det_id = psMetadataLookupS32(&status, md, "det_id");
    375379        if (!status) {
    376             psError(PS_ERR_UNKNOWN, false, "failed to lookup value for position");
    377             psFree(mds);
    378             return false;
    379         }
    380         psMetadataAddS32(mds->data[i], PS_LIST_HEAD, "det_id", 0, NULL, position);
     380            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for det_id");
     381            return false;
     382        }
     383        psMetadataRemove(md, 0, "det_id");
     384        psString det_idStr = psDBIntToString((psU64)det_id);
     385        psMetadataAddStr(mds->data[i], PS_LIST_HEAD, "det_id", 0, NULL, det_idStr);
     386        psFree(det_idStr);
    381387    }
    382388
     
    486492    }
    487493
    488     // grab the 'position' column's value as the new det_id
    489494    // the first iteration is always 0
    490     // XXX the camera name is set from the first inputExp
    491     detRunInsert(config->dbh, 0, det_type, "run");
     495    // XXX det_id
     496    detRunInsert(config->dbh, 0, 0, det_type, "run");
    492497    long det_id = psDBLastInsertID(config->dbh);
    493498
     
    538543    {
    539544        psMetadata *where = psMetadataAlloc();
    540         // map det_id -> position
    541         psMetadataAddS32(where, PS_LIST_TAIL, "position", 0, "==", det_id);
     545        psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", det_id);
    542546        detRuns = psDBSelectRows(config->dbh, "detRun", where, 0);
    543547        psFree(where);
     
    553557    }
    554558
    555     // map position -> det_id
    556     if (!mapPositionToDetRun(detRuns)) {
    557         psError(PS_ERR_UNKNOWN, false, "failed to map position -> det_id");
     559    // convert det_id to a string externaly
     560    if (!convertDetIdToStr(detRuns)) {
     561        psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    558562        psFree(detRuns);
    559563        return false;
     
    583587    }
    584588
    585     // map position -> det_id
    586     if (!mapPositionToDetRun(runs)) {
    587         psError(PS_ERR_UNKNOWN, false, "failed to map position -> det_id");
     589    // convert det_id to a string externaly
     590    if (!convertDetIdToStr(runs)) {
     591        psError(PS_ERR_UNKNOWN, false, "failed to convert det_id to a string");
    588592        psFree(runs);
    589593        return false;
     
    695699            " FROM rawImfile"
    696700            " JOIN detInputExp USING(exp_tag) "
    697             " JOIN detRun ON detInputExp.det_id = detRun.position"
     701            " JOIN detRun ON detInputExp.det_id = detRun.det_id"
    698702            " WHERE detRun.state = 'run'"
    699703        );
     
    752756    // select det_id, det_type & rawImfile *
    753757    // get det_id from detInputExp.det_id
    754     // get det_type from detRun.position
     758    // get det_type from detRun.det_id
    755759    //
    756760    // det_id is in detInputExp
     
    763767            " FROM rawImfile"
    764768            " LEFT JOIN detInputExp USING(exp_tag) "
    765             " LEFT JOIN detRun ON detInputExp.det_id = detRun.position"
     769            " LEFT JOIN detRun ON detInputExp.det_id = detRun.det_id"
    766770            " LEFT JOIN detProcessedImfile"
    767771                " ON detInputExp.det_id = detProcessedImfile.det_id"
     
    10331037        " FROM detRun"
    10341038        " JOIN detInputExp"
    1035         "    ON detRun.position = detInputExp.det_id"
     1039        "    ON detRun.det_id = detInputExp.det_id"
    10361040        "    AND detRun.iteration = detInputExp.iteration"
    10371041        " JOIN rawDetrendExp"
     
    10551059        "    rawImfile.class_id,"
    10561060        "    detInputExp.exp_tag,"
    1057         "    detRun.position"
     1061        "    detRun.det_id"
    10581062        " HAVING"
    10591063        "    COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)"
     
    11911195        " FROM detRun"
    11921196        " JOIN detInputExp"
    1193         "    ON detRun.position = detInputExp.det_id"
     1197        "    ON detRun.det_id = detInputExp.det_id"
    11941198        "    AND detRun.iteration = detInputExp.iteration"
    11951199        " JOIN rawDetrendExp"
     
    12091213        "   AND detProcessedExp.exp_tag IS NULL"
    12101214        "   AND detInputExp.include = 1"
    1211         "   AND detRun.position = %s"
     1215        "   AND detRun.det_id = %s"
    12121216        "   AND detProcessedImfile.exp_tag = '%s'"
    12131217        " GROUP BY"
    12141218        "    detProcessedImfile.class_id,"
    12151219        "    rawImfile.class_id,"
    1216         "    detRun.position"
     1220        "    detRun.det_id"
    12171221        " HAVING"
    12181222        "    COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)"
     
    13421346        " FROM detRun"
    13431347        " JOIN detInputExp"
    1344         "    ON detRun.position = detInputExp.det_id"
     1348        "    ON detRun.det_id = detInputExp.det_id"
    13451349        "    AND detRun.iteration = detInputExp.iteration"
    13461350        " JOIN rawDetrendExp"
     
    13641368        " GROUP BY"
    13651369        "    rawImfile.class_id,"
    1366         "    detRun.position"
     1370        "    detRun.det_id"
    13671371        " HAVING"
    13681372        "    COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)"
     
    14291433        " FROM detProcessedImfile"
    14301434        " JOIN detRun"
    1431         "   ON detRun.position = detProcessedImfile.det_id"
     1435        "   ON detRun.det_id = detProcessedImfile.det_id"
    14321436        " JOIN detInputExp"
    1433         "   ON detRun.position = detInputExp.det_id"
     1437        "   ON detRun.det_id = detInputExp.det_id"
    14341438        "   AND detRun.iteration = detInputExp.iteration"
    14351439        " WHERE"
     
    17021706    PS_ASSERT_PTR_NON_NULL(config, false);
    17031707
    1704     // select detRun.position (det_id)
     1708    // select detRun.det_id (det_id)
    17051709    // select detRun.iteration
    17061710    // by:
     
    17171721    psString query = psStringCopy(
    17181722        "SELECT DISTINCT"
    1719         "     detRun.position AS det_id,"
     1723        "     detRun.det_id AS det_id,"
    17201724        "     detRun.det_type,"
    17211725        "     detRun.iteration,"
     
    17231727        " FROM detRun"
    17241728        " JOIN detInputExp"
    1725         "     ON detRun.position = detInputExp.det_id"
     1729        "     ON detRun.det_id = detInputExp.det_id"
    17261730        "     AND detRun.iteration = detInputExp.iteration"
    17271731        " JOIN rawDetrendExp"
     
    17311735        "     AND detInputExp.iteration = detStackedImfile.iteration"
    17321736        " LEFT JOIN detNormalizedStatImfile"
    1733         "     ON detRun.position = detNormalizedStatImfile.det_id"
     1737        "     ON detRun.det_id = detNormalizedStatImfile.det_id"
    17341738        "     AND detRun.iteration = detNormalizedStatImfile.iteration"
    17351739        " WHERE"
     
    17401744        "     rawDetrendExp.exp_tag,"
    17411745        "     detRun.iteration,"
    1742         "     detRun.position"
     1746        "     detRun.det_id"
    17431747        " HAVING MAX(rawDetrendExp.imfiles) = COUNT(detStackedImfile.class_id)"
    17441748        );
     
    19221926        " FROM detRun"
    19231927        " JOIN detInputExp"
    1924         "   ON detRun.position = detInputExp.det_id"
     1928        "   ON detRun.det_id = detInputExp.det_id"
    19251929        "   AND detRun.iteration = detInputExp.iteration"
    19261930        " JOIN detStackedImfile"
    1927         "   ON detRun.position = detStackedImfile.det_id"
     1931        "   ON detRun.det_id = detStackedImfile.det_id"
    19281932        "   AND detRun.iteration = detStackedImfile.iteration"
    19291933        " JOIN detNormalizedStatImfile"
    1930         "   ON detRun.position = detNormalizedStatImfile.det_id"
     1934        "   ON detRun.det_id = detNormalizedStatImfile.det_id"
    19311935        "   AND detRun.iteration = detNormalizedStatImfile.iteration"
    19321936        " JOIN rawDetrendExp"
    19331937        "   ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
    19341938        " LEFT JOIN detNormalizedImfile"
    1935         "   ON detRun.position = detNormalizedImfile.det_id"
     1939        "   ON detRun.det_id = detNormalizedImfile.det_id"
    19361940        "   AND detRun.iteration = detNormalizedImfile.iteration"
    19371941        "   AND detNormalizedStatImfile.class_id = detNormalizedImfile.class_id"
     
    22312235    psString query = psStringCopy(
    22322236        " SELECT DISTINCT"
    2233         "    detRun.position as det_id,"
     2237        "    detRun.det_id as det_id,"
    22342238        "    detRun.iteration,"
    22352239        "    detRun.det_type,"
     
    22402244        " FROM detRun"
    22412245        " JOIN detInputExp"
    2242         "    ON detRun.position = detInputExp.det_id"
     2246        "    ON detRun.det_id = detInputExp.det_id"
    22432247        "    AND detRun.iteration = detInputExp.iteration"
    22442248        " JOIN rawDetrendExp"
     
    22602264        " GROUP BY"
    22612265        "    detNormalizedImfile.iteration,"
    2262         "    detRun.position"
     2266        "    detRun.det_id"
    22632267        " HAVING"
    22642268        "    COUNT(detNormalizedImfile.class_id) = COUNT(rawImfile.class_id)"
     
    23862390    psString query = psStringCopy(
    23872391        " SELECT DISTINCT"
    2388         "    detRun.position as det_id,"
     2392        "    detRun.det_id as det_id,"
    23892393        "    detRun.iteration,"
    23902394        "    detRun.det_type,"
     
    23952399        " FROM detRun"
    23962400        " JOIN detInputExp"
    2397         "    ON detRun.position = detInputExp.det_id"
     2401        "    ON detRun.det_id = detInputExp.det_id"
    23982402        "    AND detRun.iteration = detInputExp.iteration"
    23992403        " JOIN rawDetrendExp"
     
    24132417        "   AND detNormalizedExp.iteration IS NULL"
    24142418        "   AND detInputExp.include = 1"
    2415         "   AND detRun.position = %s"
     2419        "   AND detRun.det_id = %s"
    24162420        "   AND detNormalizedImfile.iteration = %d"
    24172421        " GROUP BY"
    24182422        "    detNormalizedImfile.iteration,"
    2419         "    detRun.position"
     2423        "    detRun.det_id"
    24202424        " HAVING"
    24212425        "    COUNT(detNormalizedImfile.class_id) = COUNT(rawImfile.class_id)"
     
    26062610        " FROM detRun"
    26072611        " JOIN detInputExp"
    2608         "   ON detRun.position = detInputExp.det_id"
     2612        "   ON detRun.det_id = detInputExp.det_id"
    26092613        "   AND detRun.iteration = detInputExp.iteration"
    26102614        " JOIN rawDetrendExp"
    26112615        "   ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
    26122616        " JOIN detProcessedImfile"
    2613         "   ON detRun.position = detProcessedImfile.det_id"
     2617        "   ON detRun.det_id = detProcessedImfile.det_id"
    26142618        "   AND detInputExp.exp_tag = detProcessedImfile.exp_tag"
    26152619        " JOIN detNormalizedImfile"
    2616         "   ON detRun.position = detNormalizedImfile.det_id"
     2620        "   ON detRun.det_id = detNormalizedImfile.det_id"
    26172621        "   AND detRun.iteration = detNormalizedImfile.iteration"
    26182622        "   AND detProcessedImfile.class_id = detNormalizedImfile.class_id"
    26192623        " LEFT JOIN detResidImfile"
    2620         "   ON detRun.position = detResidImfile.det_id"
     2624        "   ON detRun.det_id = detResidImfile.det_id"
    26212625        "   AND detRun.iteration = detResidImfile.iteration"
    26222626        "   AND detProcessedImfile.exp_tag = detResidImfile.exp_tag"
     
    26892693        " FROM detNormalizedImfile"
    26902694        " JOIN detRun"
    2691         "   ON detNormalizedImfile.det_id = detRun.position"
     2695        "   ON detNormalizedImfile.det_id = detRun.det_id"
    26922696        " WHERE"
    26932697        "   detRun.state = 'run'"
     
    30823086
    30833087
    3084     // select detRun.position
     3088    // select detRun.det_id
    30853089    // select detRun.iteration
    30863090    // select detRun.det_type
     
    31033107        " FROM"
    31043108        "   (SELECT DISTINCT"
    3105         "       detRun.position AS det_id,"
     3109        "       detRun.det_id AS det_id,"
    31063110        "       detRun.iteration,"
    31073111        "       detRun.det_type,"
     
    31113115        "   FROM detRun"
    31123116        "       LEFT JOIN detInputExp"
    3113         "       ON detRun.position = detInputExp.det_id"
     3117        "       ON detRun.det_id = detInputExp.det_id"
    31143118        "       AND detRun.iteration = detInputExp.iteration"
    31153119        "   LEFT JOIN rawDetrendExp"
    31163120        "       ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
    31173121        "   LEFT JOIN detResidImfile"
    3118         "       ON detRun.position = detResidImfile.det_id"
     3122        "       ON detRun.det_id = detResidImfile.det_id"
    31193123        "       AND detRun.iteration = detResidImfile.iteration"
    31203124        "       AND detInputExp.exp_tag = detResidImfile.exp_tag"
    31213125        "   LEFT JOIN detResidExp"
    3122         "       ON detRun.position = detResidExp.det_id"
     3126        "       ON detRun.det_id = detResidExp.det_id"
    31233127        "       AND detRun.iteration = detResidExp.iteration"
    31243128        "       AND detInputExp.exp_tag = detResidExp.exp_tag"
     
    31313135        "       detInputExp.exp_tag,"
    31323136        "       detRun.iteration,"
    3133         "       detRun.position"
     3137        "       detRun.det_id"
    31343138        "   HAVING"
    31353139        "       rawDetrendExp.imfiles = COUNT(detResidImfile.class_id)"
     
    31993203
    32003204
    3201     // select detRun.position
     3205    // select detRun.det_id
    32023206    // select detRun.iteration
    32033207    // select detRun.det_type
     
    32193223        " FROM"
    32203224        "   (SELECT DISTINCT"
    3221         "       detRun.position AS det_id,"
     3225        "       detRun.det_id AS det_id,"
    32223226        "       detRun.iteration,"
    32233227        "       detRun.det_type,"
     
    32273231        "   FROM detRun"
    32283232        "       LEFT JOIN detInputExp"
    3229         "       ON detRun.position = detInputExp.det_id"
     3233        "       ON detRun.det_id = detInputExp.det_id"
    32303234        "       AND detRun.iteration = detInputExp.iteration"
    32313235        "   LEFT JOIN rawDetrendExp"
    32323236        "       ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
    32333237        "   LEFT JOIN detResidImfile"
    3234         "       ON detRun.position = detResidImfile.det_id"
     3238        "       ON detRun.det_id = detResidImfile.det_id"
    32353239        "       AND detRun.iteration = detResidImfile.iteration"
    32363240        "       AND detInputExp.exp_tag = detResidImfile.exp_tag"
    32373241        "   LEFT JOIN detResidExp"
    3238         "       ON detRun.position = detResidExp.det_id"
     3242        "       ON detRun.det_id = detResidExp.det_id"
    32393243        "       AND detRun.iteration = detResidExp.iteration"
    32403244        "       AND detInputExp.exp_tag = detResidExp.exp_tag"
     
    32473251        "       detInputExp.exp_tag,"
    32483252        "       detRun.iteration,"
    3249         "       detRun.position"
     3253        "       detRun.det_id"
    32503254        "   HAVING"
    32513255        "       rawDetrendExp.imfiles = COUNT(detResidImfile.class_id)"
     
    34913495            "   USING(det_id, exp_tag, iteration)"
    34923496            " JOIN detRun"
    3493             "   ON detResidExp.det_id = detRun.position"
     3497            "   ON detResidExp.det_id = detRun.det_id"
    34943498            "   AND detResidExp.iteration = detRun.iteration"
    34953499            " WHERE"
     
    35523556     */
    35533557
    3554     // select detRun.position
     3558    // select detRun.det_id
    35553559    // select detRun.iteration
    35563560    // select detRun.det_type
     
    35693573        " FROM"
    35703574        "   (SELECT DISTINCT"
    3571         "       detRun.position AS det_id,"
     3575        "       detRun.det_id AS det_id,"
    35723576        "       detRun.iteration,"
    35733577        "       detRun.det_type,"
     
    35763580        "   FROM detRun"
    35773581        "       LEFT JOIN detInputExp"
    3578         "       ON detRun.position = detInputExp.det_id"
     3582        "       ON detRun.det_id = detInputExp.det_id"
    35793583        "       AND detRun.iteration = detInputExp.iteration"
    35803584        "   LEFT JOIN rawDetrendExp"
    35813585        "       ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
    35823586        "   LEFT JOIN detResidExp"
    3583         "       ON detRun.position = detResidExp.det_id"
     3587        "       ON detRun.det_id = detResidExp.det_id"
    35843588        "       AND detRun.iteration = detResidExp.iteration"
    35853589        "       AND detInputExp.exp_tag = detResidExp.exp_tag"
     
    35873591        "       detRun.state = 'run'"
    35883592        "   GROUP BY"
    3589         "       detRun.position,"
     3593        "       detRun.det_id,"
    35903594        "       detRun.iteration"
    35913595        "   HAVING"
     
    38203824    PS_ASSERT_PTR_NON_NULL(config, false);
    38213825
    3822     // select detRun.position
     3826    // select detRun.det_id
    38233827    // select detRun.iteration
    38243828    // by:
     
    38343838        " FROM"
    38353839        "   (SELECT DISTINCT"
    3836         "       detRun.position AS det_id,"
     3840        "       detRun.det_id AS det_id,"
    38373841        "       detRun.iteration,"
    38383842        "       detInputExp.exp_tag"
    38393843        "   FROM detRun"
    38403844        "       LEFT JOIN detInputExp"
    3841         "       ON detRun.position = detInputExp.det_id"
     3845        "       ON detRun.det_id = detInputExp.det_id"
    38423846        "       AND detRun.iteration = detInputExp.iteration"
    38433847        "   LEFT JOIN rawDetrendExp"
    38443848        "       ON detInputExp.exp_tag = rawDetrendExp.exp_tag"
    38453849        "   LEFT JOIN detResidExp"
    3846         "       ON detRun.position = detResidExp.det_id"
     3850        "       ON detRun.det_id = detResidExp.det_id"
    38473851        "       AND detRun.iteration = detResidExp.iteration"
    38483852        "       AND detInputExp.exp_tag = detResidExp.exp_tag"
     
    38503854        "       detRun.state = 'run'"
    38513855        "   GROUP BY"
    3852         "       detRun.position,"
     3856        "       detRun.det_id,"
    38533857        "       detRun.iteration"
    38543858        "   HAVING"
     
    40674071    // -again
    40684072
    4069     // select detRun.position
     4073    // select detRun.det_id
    40704074    // select detRun.iteration
    40714075    // select detInputExp.exp_tag
     
    40794083    psString query = psStringCopy(
    40804084        "SELECT DISTINCT"
    4081         "   detRun.position AS det_id,"
     4085        "   detRun.det_id AS det_id,"
    40824086        "   detRun.iteration,"
    40834087        "   detInputExp.exp_tag,"
     
    40854089        " FROM detRun"
    40864090        " JOIN detInputExp"
    4087         "   ON detRun.position = detInputExp.det_id"
     4091        "   ON detRun.det_id = detInputExp.det_id"
    40884092        "   AND detRun.iteration = detInputExp.iteration"
    40894093        " JOIN detResidExp"
    4090         "   ON detRun.position = detResidExp.det_id"
     4094        "   ON detRun.det_id = detResidExp.det_id"
    40914095        "   AND detRun.iteration = detResidExp.iteration"
    40924096        "   AND detInputExp.exp_tag = detResidExp.exp_tag"
     
    40994103    psStringAppend (
    41004104        &query,
    4101         "  AND detRun.position = '%s'", det_id);
     4105        "  AND detRun.det_id = '%s'", det_id);
    41024106
    41034107    psStringAppend (
    41044108        &query,
    41054109        " GROUP BY"
    4106         "   detRun.position,"
     4110        "   detRun.det_id,"
    41074111        "   detRun.iteration,"
    41084112        "   detInputExp.exp_tag"
     
    43744378    PS_ASSERT_PTR_NON_NULL(det_id, 0);
    43754379
    4376     char *query = "UPDATE detRun SET iteration = iteration + 1 WHERE position = '%s'";
     4380    char *query = "UPDATE detRun SET iteration = iteration + 1 WHERE det_id = '%s'";
    43774381    if (!p_psDBRunQuery(config->dbh, query, det_id)) {
    43784382        psError(PS_ERR_UNKNOWN, false,
     
    43824386
    43834387    psMetadata *where = psMetadataAlloc();
    4384     if (!psMetadataAddS32(where, PS_LIST_TAIL, "position", 0, "==",
     4388    if (!psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==",
    43854389                (psS32)atol(det_id))) {
    43864390        psError(PS_ERR_UNKNOWN, false, "failed to add item det_id");
     
    44144418    PS_ASSERT_PTR_NON_NULL(state, false);
    44154419
    4416     char *query = "UPDATE detRun SET state = '%s' WHERE position = '%s'";
     4420    char *query = "UPDATE detRun SET state = '%s' WHERE det_id = '%s'";
    44174421    if (!p_psDBRunQuery(config->dbh, query, state, det_id)) {
    44184422        psError(PS_ERR_UNKNOWN, false,
Note: See TracChangeset for help on using the changeset viewer.