IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 23, 2009, 3:15:52 PM (17 years ago)
Author:
Paul Price
Message:

Fixing query for advance mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/difftool.c

    r25509 r25515  
    583583    }
    584584
     585    psString whereString = psStringCopy("");
    585586    if (psListLength(where->list)) {
    586587        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    587         psStringAppend(&query, " WHERE %s", whereClause);
     588        psStringAppend(&whereString, "\n AND %s", whereClause);
    588589        psFree(whereClause);
    589590    }
     
    599600    if (!psDBTransaction(config->dbh)) {
    600601        psError(PS_ERR_UNKNOWN, false, "database error");
    601         return false;
    602     }
    603 
    604     if (!p_psDBRunQuery(config->dbh, query)) {
     602        psFree(whereString);
     603        return false;
     604    }
     605
     606    if (!p_psDBRunQueryF(config->dbh, query, whereString)) {
    605607        psError(PS_ERR_UNKNOWN, false, "database error");
    606608        psFree(query);
     609        psFree(whereString);
    607610        if (!psDBRollback(config->dbh)) {
    608611            psError(PS_ERR_UNKNOWN, false, "database error");
     
    611614    }
    612615    psFree(query);
     616    psFree(whereString);
    613617
    614618    psArray *output = p_psDBFetchResult(config->dbh);
Note: See TracChangeset for help on using the changeset viewer.