Changeset 19582
- Timestamp:
- Sep 16, 2008, 10:09:43 AM (18 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 2 edited
-
share/difftool_inputskyfile.sql (modified) (2 diffs)
-
src/difftool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/difftool_inputskyfile.sql
r19092 r19582 35 35 AND camRun.state = 'full' 36 36 AND chipRun.state = 'full' 37 -- where hook %s 37 38 UNION 38 39 SELECT … … 71 72 AND camRun.state = 'full' 72 73 AND chipRun.state = 'full' 74 -- where hook %s 73 75 ) as Foo -
trunk/ippTools/src/difftool.c
r19525 r19582 318 318 } 319 319 320 psString whereClause = NULL; 320 321 if (psListLength(where->list)) { 321 psStringwhereClause = psDBGenerateWhereConditionSQL(where, NULL);322 psString Append(&query, " WHERE %s", whereClause);323 psFree(whereClause);324 }322 whereClause = psDBGenerateWhereConditionSQL(where, NULL); 323 psStringPrepend(&whereClause, "\n AND "); 324 } 325 psFree(where); 325 326 326 327 // Add condition to get only templates or only inputs 327 328 { 328 psString whereClause = NULL;329 psString templateClause = NULL; 329 330 if (template) { 330 psStringAppend(& whereClause, " %s", " template != 0");331 psStringAppend(&templateClause, " %s", " template != 0"); 331 332 } else if (input) { 332 psStringAppend(&whereClause, " %s", " template = 0"); 333 } 334 if (whereClause) { 335 psStringAppend(&query, " %s %s", psListLength(where->list) ? "AND" : "WHERE", whereClause); 336 } 337 psFree(whereClause); 338 } 339 340 psFree(where); 333 psStringAppend(&templateClause, " %s", " template = 0"); 334 } 335 if (templateClause) { 336 psStringAppend(&whereClause, "\n AND %s", templateClause); 337 } 338 psFree(templateClause); 339 } 340 341 341 342 342 // treat limit == 0 as "no limit" … … 347 347 } 348 348 349 if (!p_psDBRunQuery(config->dbh, query)) { 350 psError(PS_ERR_UNKNOWN, false, "database error"); 349 if (!p_psDBRunQuery(config->dbh, query, whereClause, whereClause)) { 350 psError(PS_ERR_UNKNOWN, false, "database error"); 351 psFree(whereClause); 351 352 psFree(query); 352 353 return false; 353 354 } 355 psFree(whereClause); 354 356 psFree(query); 355 357
Note:
See TracChangeset
for help on using the changeset viewer.
