Changeset 26039
- Timestamp:
- Nov 4, 2009, 7:14:15 PM (17 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 2 edited
-
share/magictool_definebyquery_select.sql (modified) (2 diffs)
-
src/magictool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/magictool_definebyquery_select.sql
r26033 r26039 1 1 -- Get a list of exposures on which magic may be performed 2 2 SELECT DISTINCT 3 exp_id,3 chipRun.exp_id, 4 4 MAX(diffWarps.diff_id) AS diff_id, 5 5 -- The following trick pulls out the 'inverse' value for the maximum diff_id … … 33 33 JOIN camRun USING(cam_id) 34 34 JOIN chipRun USING(chip_id) 35 LEFT JOIN magicRun USING(exp_id) 35 LEFT JOIN 36 (SELECT magic_id, exp_id, label 37 FROM magicRun 38 -- rerun hook %s 39 ) AS oldMagicRun 40 ON oldMagicRun.exp_id = chipRun.exp_id 36 41 -- WHERE hook %s 37 GROUP BY exp_id42 GROUP BY chipRun.exp_id -
trunk/ippTools/src/magictool.c
r26034 r26039 151 151 // what if no skycells for the diff run completed? 152 152 153 psStringAppend(&queryWhereStr, "\n%s (magic_id IS NULL", queryWhereStr ? "AND" : "WHERE"); 153 psStringAppend(&queryWhereStr, "\n%s magic_id IS NULL", queryWhereStr ? "AND" : "WHERE"); 154 psString rerunWhereStr = NULL; 154 155 if (rerun) { 155 psStringAppend(&queryWhereStr, " OR (magicRun.label != '%s')", label); 156 } 157 psStringAppend(&queryWhereStr, ") "); 156 psStringAppend(&rerunWhereStr, "\n WHERE magicRun.label = '%s'", label); 157 } 158 158 159 159 // now add the user specified qualifiers … … 178 178 queryWhereStr = psStringCopy(""); 179 179 } 180 181 if (!p_psDBRunQueryF(config->dbh, query, diffWhereStr, diffWhereStr, queryWhereStr)) { 180 if (!rerunWhereStr) { 181 rerunWhereStr = psStringCopy(""); 182 } 183 184 if (!p_psDBRunQueryF(config->dbh, query, diffWhereStr, diffWhereStr, rerunWhereStr, queryWhereStr)) { 182 185 psError(PS_ERR_UNKNOWN, false, "database error"); 183 186 psFree(diffWhereStr); 184 187 psFree(queryWhereStr); 188 psFree(rerunWhereStr); 185 189 psFree(query); 186 190 return false; … … 188 192 psFree(diffWhereStr); 189 193 psFree(queryWhereStr); 194 psFree(rerunWhereStr); 190 195 psFree(query); 191 196 }
Note:
See TracChangeset
for help on using the changeset viewer.
