IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26180 for trunk/ippTools/src


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.