Changeset 28411 for trunk/ippTools/src/pubtool.c
- Timestamp:
- Jun 18, 2010, 4:04:27 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pubtool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
