IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 22, 2011, 2:21:40 PM (15 years ago)
Author:
heather
Message:

whoo hooo! mergetool changes, now to test on maui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/haf_add201112/ippTools/src/pxmerge.c

    r32980 r33003  
    4747        }
    4848    }
     49    if (!p_psDBRunQueryF(config->dbh,"INSERT INTO mergedvodbRun SELECT         0,   minidvodb_id, '%s', '%s', 'new', NULL FROM minidvodbRun     WHERE    minidvodbRun.minidvodb_id = %lld and minidvodbRun.state = 'merged'", mergedvodb, mergedvodb_path, (long long) minidvodb_id))
     50    {
     51      psError(PS_ERR_UNKNOWN, false, "database error %s", query);
     52        return false;
     53    }
     54    // just to be safe, we should have changed at least one row
     55    if (psDBAffectedRows(config->dbh) < 1) {
     56        psError(PS_ERR_UNKNOWN, false,
     57                "no rows affected - should have changed at least one row \n%s", query);
     58        return false;
     59    }
     60    return true;
     61}
    4962
    50     // queue the exp
    51     // Note: cam_id is being cast here work around psS64 have a different type different
    52     // on 32/64
    53     //if (!p_psDBRunQueryF(config->dbh, query,
    54     //                   minidvodb_rsync_path   ? minidvodb_rsync_path     : "NULL",
    55     //                   destination_host  ? destination_host   : "NULL",
    56     //                           0,  //fault
    57                            //                    "new", // state
    58     //                   "NULL",
    59                                                    //                      0, //dtime
    60                        
    61                                                                              //                    (long long) minidvodb_id
    62     //    ))
    63     if (!p_psDBRunQueryF(config->dbh,"INSERT INTO mergedvodbRun SELECT         0,   minidvodb_id, '%s', '%s', 'new', NULL FROM minidvodbRun     WHERE    minidvodbRun.minidvodb_id = %lld and minidvodbRun.state = 'merged'", mergedvodb, mergedvodb_path, (long long) minidvodb_id))
     63bool pxaddQueueByMergeID(pxConfig *config,
     64                       psS64 merge_id,
     65                       char *destination_host,
     66                       char *mergedvodb_rsync_path
     67  )
     68{
     69    PS_ASSERT_PTR_NON_NULL(config, false);
     70
     71    // load the SQL to enqueue our exp_ids from disk once
     72    static psString query = NULL;
     73    if (!query) {
     74        query = pxDataGet("mergetool_queue_mergecopy_id.sql");
     75        psMemSetPersistent(query, true);
     76        if (!query) {
     77            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     78            return false;
     79        }
     80    }
     81
     82    if (!p_psDBRunQueryF(config->dbh,"INSERT INTO mergedvodbCopy SELECT         0,   merge_id, '%s', '%s', 0, 'new', NULL, 0 FROM mergedvodbRun     WHERE    mergedvodbRun.merge_id = %lld and (mergedvodbRun.state = 'merged' or mergedvodbRun.state = 'full')", mergedvodb_rsync_path, destination_host, (long long) merge_id))
    6483
    6584    {
Note: See TracChangeset for help on using the changeset viewer.