IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26180 for trunk/ippTools


Ignore:
Timestamp:
Nov 18, 2009, 10:11:43 AM (17 years ago)
Author:
bills
Message:

remove diffRun state checks from -inputskyfile. They were broken for
state = 'update' and aren't needed. Fix handling of -template and -input parameters

Location:
trunk/ippTools
Files:
2 edited

Legend:

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

    r26179 r26180  
    2929    JOIN rawExp
    3030        USING(exp_id)
    31     WHERE
    32         (diffRun.state = 'new' or diffRun.state = 'full')
    33         AND (warpRun.state = 'full')
    3431        -- where hook %s
    3532    UNION
     
    6360    JOIN rawExp
    6461        USING(exp_id)
    65     WHERE
    66         (diffRun.state = 'new' or diffRun.state = 'full')
    67         AND (warpRun.state = 'full')
    6862        -- where hook %s
    6963    UNION
     
    9791    JOIN rawExp
    9892        USING(exp_id)
    99     WHERE
    100         (diffRun.state = 'new' or diffRun.state = 'full')
    10193        -- where hook %s
    10294    UNION
     
    130122    JOIN rawExp
    131123        USING(exp_id)
    132     WHERE
    133         (diffRun.state = 'new' or diffRun.state = 'full')
    134124        -- where hook %s
    135125    ) as Foo
     126-- template where hook %s
  • trunk/ippTools/src/difftool.c

    r26177 r26180  
    386386    if (psListLength(where->list)) {
    387387        whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    388         psStringPrepend(&whereClause, "\n AND ");
     388        psStringPrepend(&whereClause, "\n WHERE ");
    389389    }
    390390    psFree(where);
    391391
    392392    // Add condition to get only templates or only inputs
     393    psString templateClause = NULL;
    393394    {
    394         psString templateClause = NULL;
    395395        if (template) {
    396             psStringAppend(&templateClause, " %s", " template != 0");
     396            psStringAppend(&templateClause, "\n WHERE %s", " template != 0");
    397397        } else if (input) {
    398             psStringAppend(&templateClause, " %s", " template = 0");
    399         }
    400         if (templateClause) {
    401             psStringAppend(&whereClause, "\n AND %s", templateClause);
    402         }
    403         psFree(templateClause);
     398            psStringAppend(&templateClause, "\n WHERE %s", " template = 0");
     399        }
    404400    }
    405401
     
    412408    }
    413409
    414     if (!p_psDBRunQueryF(config->dbh, query, whereClause, whereClause, whereClause, whereClause)) {
    415         psError(PS_ERR_UNKNOWN, false, "database error");
     410    if (!p_psDBRunQueryF(config->dbh, query, whereClause, whereClause, whereClause, whereClause, templateClause)) {
     411        psError(PS_ERR_UNKNOWN, false, "database error");
     412        psFree(templateClause);
    416413        psFree(whereClause);
    417414        psFree(query);
    418415        return false;
    419416    }
     417    psFree(templateClause);
    420418    psFree(whereClause);
    421419    psFree(query);
Note: See TracChangeset for help on using the changeset viewer.