Changeset 18551
- Timestamp:
- Jul 15, 2008, 10:18:41 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/src/pstampparse.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/pstampparse.c
r18379 r18551 304 304 (_id), NULL, false, NULL)) 305 305 306 #define warpIDForCam(_opt, _id) \307 lastID(runQuery((_opt), "SELECT %s from warpInputExp WHERE cam_id = %s", "warp_id", \306 #define fakeIDForCam(_opt, _id) \ 307 lastID(runQuery((_opt), "SELECT %s from fakeRun WHERE cam_id = %s", "fake_id", \ 308 308 (_id), NULL, false, NULL)) 309 309 310 #define warpIDForFake(_opt, _id) \ 311 lastID(runQuery((_opt), "SELECT %s from warpRun WHERE fake_id = %s", "warp_id", \ 312 (_id), NULL, false, NULL)) 313 310 314 311 315 … … 317 321 return NULL; 318 322 319 psArray *chip_files = runQuery(options, 320 "SELECT %s from chipProcessedImfile WHERE chip_id = %s AND class_id = '%s'", 323 psString query = NULL; 324 psStringAppend(&query, "SELECT %s from chipProcessedImfile WHERE chip_id = %s", "%s", "%s"); 325 if (class_id && (strcmp(class_id, "null") != 0)) { 326 psStringAppend(&query, " AND class_id = '%s'", "%s"); 327 } 328 329 psArray *chip_files = runQuery(options, query, 321 330 "uri", chip_id, class_id, true, NULL); 331 psFree(query); 322 332 psFree(chip_id); 323 333 … … 336 346 return NULL; 337 347 338 psString warp_id = warpIDForCam(options, cam_id); 348 psString fake_id = fakeIDForCam(options, cam_id); 349 if (fake_id == NULL) 350 return NULL; 351 352 psString warp_id = warpIDForFake(options, fake_id); 353 if (warp_id == NULL) 354 return NULL; 339 355 340 356 psArray *warp_files = runQuery(options, … … 344 360 345 361 psFree(warp_id); 362 psFree(fake_id); 346 363 psFree(cam_id); 347 364 psFree(chip_id); … … 361 378 return NULL; 362 379 363 psString warp_id = warpIDForCam(options, cam_id); 380 psString fake_id = fakeIDForCam(options, cam_id); 381 if (fake_id == NULL) 382 return NULL; 383 384 psString warp_id = warpIDForFake(options, fake_id); 364 385 if (warp_id == NULL) 365 386 return NULL; … … 369 390 370 391 psFree(warp_id); 392 psFree(fake_id); 371 393 psFree(cam_id); 372 394 psFree(chip_id); … … 402 424 return NULL; 403 425 404 psString warp_id = warpIDForCam(options, cam_id); 426 psString fake_id = fakeIDForCam(options, cam_id); 427 if (fake_id == NULL) 428 return NULL; 429 430 psString warp_id = warpIDForFake(options, fake_id); 431 if (warp_id == NULL) 432 return NULL; 405 433 406 434 psArray *diffIDs = runQuery(options, … … 409 437 410 438 psFree(warp_id); 439 psFree(fake_id); 411 440 psFree(cam_id); 412 441 psFree(chip_id); … … 632 661 // or are there simply no images matching the request 633 662 fprintf(stderr, "No matching images found.\n"); 634 // don't return an error 635 return true; 663 return false; 636 664 } 637 665
Note:
See TracChangeset
for help on using the changeset viewer.
