Changeset 28411
- Timestamp:
- Jun 18, 2010, 4:04:27 PM (16 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 3 edited
-
share/pubtool_definerun.sql (modified) (1 diff)
-
share/pubtool_pending.sql (modified) (1 diff)
-
src/pubtool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/pubtool_definerun.sql
r28372 r28411 38 38 AND (camRun.magicked != 0 OR publishClient.magicked = 0) 39 39 -- WHERE hook %s 40 UNION 41 -- Get diffphots to publish 42 SELECT DISTINCT 43 client_id, 44 diff_phot_id AS stage_id, 45 diffPhotRun.label AS src_label 46 FROM publishClient 47 JOIN diffPhotRun 48 JOIN diffRun USING(diff_id) 49 JOIN diffInputSkyfile USING(diff_id) 50 JOIN warpRun ON warpRun.warp_id = diffInputSkyfile.warp1 -- Only JOINing input, not reference! 51 JOIN fakeRun USING(fake_id) 52 JOIN camRun USING(cam_id) 53 JOIN chipRun USING(chip_id) 54 JOIN rawExp USING(exp_id) 55 WHERE publishClient.stage = 'diffphot' 56 AND publishClient.active = 1 57 AND diffPhotRun.state IN ('full', 'cleaned', 'goto_cleaned') 58 AND (diffRun.diff_mode = 4 OR publishClient.magicked = 0) -- diffPhotRun doesn't respect magic 59 -- WHERE hook %s 40 60 ) AS publishToDo 41 61 -- Only get stuff that hasn't been published -
trunk/ippTools/share/pubtool_pending.sql
r28373 r28411 50 50 AND (camRun.magicked != 0 OR publishClient.magicked = 0) 51 51 -- WHERE hook %s 52 SELECT DISTINCT 53 publishRun.pub_id, 54 publishClient.product, 55 publishClient.stage, 56 publishClient.workdir, 57 diffPhotRun.diff_phot_id AS stage_id, 58 rawExp.camera, 59 rawExp.exp_id 60 FROM publishRun 61 JOIN publishClient USING(client_id) 62 JOIN diffPhotRun 63 ON diffPhotRun.diff_phot_id = publishRun.stage_id 64 JOIN diffRun USING(diff_id) 65 JOIN diffInputSkyfile USING(diff_id) 66 -- Need to do something fancy here to get the camera name for a stack 67 LEFT JOIN warpRun ON warpRun.warp_id = diffInputSkyfile.warp1 68 JOIN fakeRun USING(fake_id) 69 JOIN camRun USING(cam_id) 70 JOIN chipRun USING(chip_id) 71 JOIN rawExp USING(exp_id) 72 WHERE publishClient.stage = 'diffphot' 73 AND publishClient.active = 1 74 AND publishRun.state = 'new' 75 AND diffPhotRun.state IN ('full', 'cleaned', 'goto_cleaned') 76 AND (diffRun.diff_mode = 4 OR publishClient.magicked = 0) -- diffPhotRun doesn't respect magic 77 -- WHERE hook %s 52 78 ) AS publishToDo 53 79 LEFT JOIN publishDone USING(pub_id) -
trunk/ippTools/src/pubtool.c
r28373 r28411 153 153 psMetadata *diffWhere = psMetadataAlloc(); // WHERE conditions for diffs 154 154 psMetadata *camWhere = psMetadataAlloc(); // WHERE conditions for cams 155 psMetadata *diffphotWhere = psMetadataAlloc(); // WHERE conditions for diffphots 155 156 156 157 // required … … 173 174 PXOPT_COPY_STR(config->args, camWhere, "-obs_mode", "rawExp.obs_mode", "LIKE"); 174 175 176 PXOPT_COPY_S64(config->args, diffphotWhere, "-client_id", "client_id", "=="); 177 pxAddLabelSearchArgs(config, diffphotWhere, "-label", "diffphotRun.label", "=="); 178 pxAddLabelSearchArgs(config, diffphotWhere, "-data_group", "diffphotRun.data_group", "LIKE"); 179 PXOPT_COPY_TIME(config->args, diffphotWhere, "-dateobs_begin", "rawExp.dateobs", ">="); 180 PXOPT_COPY_TIME(config->args, diffphotWhere, "-dateobs_end", "rawExp.dateobs", "<="); 181 PXOPT_COPY_STR(config->args, diffphotWhere, "-filter", "rawExp.filter", "LIKE"); 182 PXOPT_COPY_STR(config->args, diffphotWhere, "-obs_mode", "rawExp.obs_mode", "LIKE"); 183 175 184 PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false); 176 185 PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false); … … 201 210 psFree(diffWhere); 202 211 psFree(camWhere); 212 psFree(diffphotWhere); 203 213 return false; 204 214 } … … 220 230 psFree(camWhere); 221 231 222 if (!p_psDBRunQueryF(config->dbh, query, whereDiff, whereCam)) { 232 psString whereDiffphot = psStringCopy(""); // Additional constraints to add to query 233 if (psListLength(diffphotWhere->list)) { 234 psString clause = psDBGenerateWhereConditionSQL(diffphotWhere, NULL); 235 psStringAppend(&whereDiffphot, "\n AND %s", clause); 236 psFree(clause); 237 } 238 psFree(diffphotWhere); 239 240 if (!p_psDBRunQueryF(config->dbh, query, whereDiff, whereCam, whereDiffphot)) { 223 241 psError(PS_ERR_UNKNOWN, false, "Database error"); 224 242 psFree(query); 225 243 psFree(whereDiff); 226 244 psFree(whereCam); 245 psFree(whereDiffphot); 227 246 if (!psDBRollback(config->dbh)) { 228 247 psError(PS_ERR_UNKNOWN, false, "Database error"); … … 233 252 psFree(whereDiff); 234 253 psFree(whereCam); 254 psFree(whereDiffphot); 235 255 236 256 psArray *output = p_psDBFetchResult(config->dbh); // Output of SELECT statement
Note:
See TracChangeset
for help on using the changeset viewer.
