IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27679


Ignore:
Timestamp:
Apr 14, 2010, 11:54:15 AM (16 years ago)
Author:
Paul Price
Message:

Fix stacktool -tosum to require that all inputs have state = 'full'.

Location:
trunk/ippTools
Files:
2 edited

Legend:

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

    r24601 r27679  
    1 SELECT DISTINCT
     1SELECT
    22    stackRun.stack_id,
    33    stackRun.tess_id,
     
    88    stackRun.state
    99FROM stackRun
    10 JOIN stackInputSkyfile
    11     USING(stack_id)
    12 LEFT JOIN stackSumSkyfile
    13     USING(stack_id)
     10JOIN stackInputSkyfile USING(stack_id)
     11JOIN warpRun USING(warp_id)
     12LEFT JOIN stackSumSkyfile USING(stack_id)
    1413WHERE
    1514    ((stackRun.state = 'new' AND stackSumSkyfile.stack_id IS NULL)
    1615    OR (stackRun.state = 'update' AND stackSumSkyfile.fault = 0 AND stackSumSkyfile.quality = 0))
     16    -- WHERE hook %s
     17GROUP BY stack_id
     18HAVING COUNT(warpRun.state = 'full') = COUNT(stackInputSkyfile.warp_id)
  • trunk/ippTools/src/stacktool.c

    r27678 r27679  
    753753    }
    754754
     755    psString whereClause = psStringCopy(""); // WHERE conditions to add
    755756    if (psListLength(where->list)) {
    756         psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    757         psStringAppend(&query, " AND %s", whereClause);
    758         psFree(whereClause);
     757        psString new = psDBGenerateWhereConditionSQL(where, NULL);
     758        psStringAppend(&whereClause, "\nAND %s", new);
     759        psFree(new);
    759760    }
    760761    psFree(where);
     
    767768    }
    768769
    769     if (!p_psDBRunQuery(config->dbh, query)) {
     770    if (!p_psDBRunQueryF(config->dbh, query, whereClause)) {
    770771        psError(PS_ERR_UNKNOWN, false, "database error");
    771772        psFree(query);
Note: See TracChangeset for help on using the changeset viewer.