Changeset 14260
- Timestamp:
- Jul 16, 2007, 6:28:21 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r14255 r14260 40 40 static bool revertdiffskyfileMode(pxConfig *config); 41 41 42 static bool setdiffRunState(pxConfig *config, const char * warp_id, const char *state);42 static bool setdiffRunState(pxConfig *config, const char *diff_id, const char *state); 43 43 44 44 # define MODECASE(caseName, func) \ … … 297 297 } 298 298 299 if (!psDBTransaction(config->dbh)) { 300 psError(PS_ERR_UNKNOWN, false, "database error"); 301 return false; 302 } 303 299 304 if (!diffInputSkyfileInsert(config->dbh, 300 305 (psS64)atoll(diff_id), … … 306 311 kind 307 312 )) { 313 if (!psDBRollback(config->dbh)) { 314 psError(PS_ERR_UNKNOWN, false, "database error"); 315 } 316 psError(PS_ERR_UNKNOWN, false, "database error"); 317 return false; 318 } 319 320 if (!p_psDBRunQuery(config->dbh, "SELECT count(diff_id) FROM diffRun JOIN diffInputSkyfile USING(diff_id) WHERE diff_id = %" PRId64, (psS64)atoll(diff_id))) { 321 if (!psDBRollback(config->dbh)) { 322 psError(PS_ERR_UNKNOWN, false, "database error"); 323 } 324 psError(PS_ERR_UNKNOWN, false, "database error"); 325 return false; 326 } 327 328 psArray *output = p_psDBFetchResult(config->dbh); 329 if (!output) { 330 if (!psDBRollback(config->dbh)) { 331 psError(PS_ERR_UNKNOWN, false, "database error"); 332 } 333 psError(PS_ERR_UNKNOWN, false, "database error"); 334 return false; 335 } 336 if (!psArrayLength(output)) { 337 if (!psDBRollback(config->dbh)) { 338 psError(PS_ERR_UNKNOWN, false, "database error"); 339 } 340 psError(PS_ERR_UNKNOWN, false, "diff_id %" PRId64 " not found", (psS64)atoll(diff_id)); 341 psFree(output); 342 return false; 343 } 344 345 psS32 count = psMetadataLookupS32(&status, output->data[0], "count(diff_id)"); 346 347 if (count == 2) { 348 if (!setdiffRunState(config, diff_id, "run")) { 349 if (!psDBRollback(config->dbh)) { 350 psError(PS_ERR_UNKNOWN, false, "database error"); 351 } 352 psError(PS_ERR_UNKNOWN, false, "database error"); 353 return false; 354 } 355 } 356 357 // point of no return 358 if (!psDBCommit(config->dbh)) { 308 359 psError(PS_ERR_UNKNOWN, false, "database error"); 309 360 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
