IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27168


Ignore:
Timestamp:
Mar 3, 2010, 3:23:12 PM (16 years ago)
Author:
watersc1
Message:

Slight bug in the updatebyquery code, in which updating an exposure with a select by state would invalidate the update of the imfiles. The sql change helps avoid this issue.

Location:
trunk/ippTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/regtool_pendingcompressimfile.sql

    r27163 r27168  
    11SELECT rawImfile.*,rawExp.workdir,rawExp.exp_tag from rawImfile
    22       JOIN rawExp USING(exp_id)
    3        WHERE (data_state = 'goto_compressed' OR data_state = 'goto_lossy')
     3       WHERE ((data_state = 'goto_compressed' AND state = 'goto_compressed')
     4           OR (data_state = 'goto_lossy' AND state = 'goto_lossy'))
    45-- where hook %s
    56-- limit hook %s       
  • trunk/ippTools/src/regtool.c

    r27153 r27168  
    13561356  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    13571357
    1358   psString query = pxDataGet("regtool_updatebyquery.sql");
    1359   if (!query) {
    1360     psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
    1361     return(false);
    1362   }
    13631358  psString limitString = NULL;
    13641359  if (limit) {
     
    13661361    psStringPrepend(&limitString, "\n");
    13671362  }
     1363  // Update the imfiles first, because if you select by state, you'll clobber things
     1364  psString query = pxDataGet("regtool_updatebyqueryimfile.sql");
     1365  if (!query) {
     1366    psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     1367    return(false);
     1368  }
     1369
    13681370  //  printf(query,set_state,whereClause,limitString);
    13691371  if (!p_psDBRunQueryF(config->dbh, query, set_state, whereClause, limitString ? limitString : "")) {
     
    13771379
    13781380  psFree(query);
    1379   // Now up date the imfiles.
    1380   query = pxDataGet("regtool_updatebyqueryimfile.sql");
     1381  // Now up date the exposure.
     1382  query = pxDataGet("regtool_updatebyquery.sql"); 
    13811383  if (!query) {
    13821384    psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
Note: See TracChangeset for help on using the changeset viewer.