Changeset 17618 for trunk/ippTools/src/regtool.c
- Timestamp:
- May 9, 2008, 11:48:09 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r17611 r17618 430 430 431 431 // treat limit == 0 as "no limit" 432 psString limitString = NULL; 432 433 if (limit) { 433 psString limitString = psDBGenerateLimitSQL(limit); 434 psStringAppend(&query, " %s", limitString); 435 psFree(limitString); 436 } 437 438 // close subquery 439 psStringAppend(&query, "\n ) as Foo\n"); 440 441 if (!p_psDBRunQuery(config->dbh, query)) { 434 limitString = psDBGenerateLimitSQL(limit); 435 // skip past the "hook" comment 436 psStringPrepend(&limitString, "\n"); 437 } 438 439 // 1st arg: where hook, 2nd arg: limit hook 440 if (!p_psDBRunQuery(config->dbh, query, "", limitString ? limitString : "")) { 442 441 // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms) 443 442 psError(PXTOOLS_ERR_PROG, false, "database error"); 443 psFree(limitString); 444 444 psFree(query); 445 445 return false; 446 446 } 447 psFree(limitString); 447 448 psFree(query); 448 449 … … 558 559 } 559 560 560 // close subquery (left open for limit supplied to pendingexpMode (regtool.c:104) 561 psStringAppend(&query, "\n ) as Foo\n"); 562 561 psString whereClause = NULL; 563 562 { 564 563 // build a query to search by exp_id … … 571 570 } 572 571 573 psString whereClause = psDBGenerateWhereSQL(where, NULL);572 whereClause = psDBGenerateWhereConditionSQL(where, NULL); 574 573 psFree(where); 575 574 if (whereClause) { 576 psStringAppend(&query, " %s", whereClause); 575 // skip past comment "hook" 576 psStringPrepend(&whereClause, "\n AND "); 577 } 578 } 579 580 // 1st arg: where hook, 2nd arg: limit hook 581 if (!p_psDBRunQuery(config->dbh, query, whereClause ? whereClause : "", "")) { 582 psError(PS_ERR_UNKNOWN, false, "database error"); 577 583 psFree(whereClause); 578 }579 }580 581 if (!p_psDBRunQuery(config->dbh, query)) {582 psError(PS_ERR_UNKNOWN, false, "database error");583 584 psFree(query); 584 585 return false; 585 586 } 587 psFree(whereClause); 586 588 psFree(query); 587 589
Note:
See TracChangeset
for help on using the changeset viewer.
