Changeset 15287
- Timestamp:
- Oct 11, 2007, 1:47:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pzgetimfiles.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pzgetimfiles.c
r15159 r15287 261 261 psFree(newImfiles); 262 262 263 // queue the imfiles (files) in pzPendingImfile -- must be done before the264 // imfile is insterted into summitImfile (after that happens when don't265 // know which imfiles are new anymore (well thats not exactly true but it266 // make be someday if we have to beable to resync to modified datastore267 // entries)268 { 269 char *query = 270 "INSERT I NTO pzPendingImfile"263 // queue the imfiles (files) dest. for pzPendingImfile in pending -- must 264 // be done before the imfile is insterted into summitImfile (after that 265 // happens when don't know which imfiles are new anymore (well thats not 266 // exactly true but it may be someday if we have to beable to resync to 267 // modified datastore entries) 268 { 269 char *query = 270 "INSERT IGNORE INTO pzPendingImfile" 271 271 " SElECT" 272 272 " incoming.exp_name," … … 275 275 " incoming.class," 276 276 " incoming.class_id" 277 " FROM incoming" 278 " JOIN pzPendingExp" 279 " USING(exp_name, camera, telescope)" 280 " LEFT JOIN summitImfile" 281 " USING(exp_name, camera, telescope, class, class_id)" 282 " WHERE" 283 " summitImfile.exp_name is NULL" 284 " AND summitImfile.camera is NULL" 285 " AND summitImfile.telescope is NULL" 286 " AND summitImfile.class is NULL" 287 " AND summitImfile.class_id is NULL"; 277 " FROM incoming"; 288 278 289 279 if (!p_psDBRunQuery(config->dbh, query)) { … … 297 287 } 298 288 299 if (!p_psDBRunQuery(config->dbh, "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED")) {300 // rollback301 if (!psDBRollback(config->dbh)) {302 psError(PS_ERR_UNKNOWN, false, "database error");303 }304 psError(PS_ERR_UNKNOWN, false, "database error");305 return false;306 }307 308 289 // copy imfiles (files) from the temp table into summitImfiles 309 290 { 310 291 char *query = 311 "INSERT I NTO summitImfile"292 "INSERT IGNORE INTO summitImfile" 312 293 " SElECT" 313 294 " incoming.exp_name," … … 320 301 " incoming.class_id," 321 302 " incoming.uri" 322 " FROM incoming" 323 " LEFT JOIN summitImfile" 324 " USING(exp_name, camera, telescope, class, class_id)" 325 " WHERE" 326 " summitImfile.exp_name is NULL" 327 " AND summitImfile.camera is NULL" 328 " AND summitImfile.telescope is NULL" 329 " AND summitImfile.class is NULL" 330 " AND summitImfile.class_id is NULL"; 331 303 " FROM incoming"; 332 304 if (!p_psDBRunQuery(config->dbh, query)) { 333 305 // rollback … … 353 325 " exp_name = '%s'" 354 326 " AND camera = '%s'" 355 " AND telescope = '%s'"; 327 " AND telescope = '%s'" 328 " AND imfiles IS NULL"; 356 329 if (!p_psDBRunQuery(config->dbh, query, filesetid, camera, telescope, filesetid, camera, telescope)) { 357 330 // rollback
Note:
See TracChangeset
for help on using the changeset viewer.
