Changeset 10035
- Timestamp:
- Nov 16, 2006, 6:24:38 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pzgetimfiles.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pzgetimfiles.c
r10024 r10035 184 184 // point of no return 185 185 if (!psDBCommit(config->dbh)) { 186 // rollback 187 if (!psDBRollback(config->dbh)) { 188 psError(PS_ERR_UNKNOWN, false, "database error"); 189 } 186 190 psError(PS_ERR_UNKNOWN, false, "database error"); 187 191 return false; … … 237 241 psFree(newImfiles); 238 242 239 // queue the imfiles (files) in pzPendingImfile 243 // queue the imfiles (files) in pzPendingImfile -- must be done before the 244 // imfile is insterted into summitImfile (after that happens when don't 245 // know which imfiles are new anymore (well thats not exactly true but it 246 // make be someday if we have to beable to resync to modified datastore 247 // entries) 240 248 { 241 249 char *query = … … 247 255 " incoming.class," 248 256 " incoming.class_id," 249 " pzPendingExp.exp_tag"257 " NULL" // exp_tag, will be assigned later 250 258 " FROM incoming" 251 259 " JOIN pzPendingExp" … … 270 278 } 271 279 272 // moveimfiles (files) from the temp table into summitImfiles280 // copy imfiles (files) from the temp table into summitImfiles 273 281 { 274 282 char *query = … … 327 335 } 328 336 337 // copy the summitExp row into newExp in order to create a new exp_tag 338 { 339 char *query = 340 "INSERT INTO newExp" 341 " SElECT" 342 " NULL," // exp_tag 343 " summitExp.exp_id," 344 " summitExp.camera," 345 " summitExp.telescope," 346 " summitExp.dateobs," 347 " summitExp.exp_type," 348 " summitExp.imfiles" 349 " FROM summitExp" 350 " WHERE" 351 " summitExp.exp_id = '%s'" 352 " AND summitExp.camera = '%s'" 353 " AND summitExp.telescope = '%s'"; 354 355 if (!p_psDBRunQuery(config->dbh, query)) { 356 // rollback 357 if (!psDBRollback(config->dbh)) { 358 psError(PS_ERR_UNKNOWN, false, "database error"); 359 } 360 psError(PS_ERR_UNKNOWN, false, "database error"); 361 return false; 362 } 363 } 364 365 // set the exp_tag for the imfiles (files) in the exposure (fileset) that 366 // we are investigating 367 { 368 char *query = 369 "UPDATE pzPendingImfile" 370 " SET exp_tag = LAST_INSERT_ID()" 371 " WHERE" 372 " exp_id = '%s'" 373 " AND camera = '%s'" 374 " AND telescope = '%s'"; 375 if (!p_psDBRunQuery(config->dbh, query, filesetid, camera, telescope)) { 376 // rollback 377 if (!psDBRollback(config->dbh)) { 378 psError(PS_ERR_UNKNOWN, false, "database error"); 379 } 380 psError(PS_ERR_UNKNOWN, false, "database error"); 381 return false; 382 } 383 } 384 329 385 // remove the pzPendingExp entry for this exp (fileset) 330 386 { … … 347 403 // point of no return 348 404 if (!psDBCommit(config->dbh)) { 405 // rollback 406 if (!psDBRollback(config->dbh)) { 407 psError(PS_ERR_UNKNOWN, false, "database error"); 408 } 349 409 psError(PS_ERR_UNKNOWN, false, "database error"); 350 410 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
