Changeset 19249 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Aug 27, 2008, 3:37:35 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r19159 r19249 141 141 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 142 142 143 if (!psListLength(where->list) && 144 !psMetadataLookupBool(NULL, config->args, "-all")) {143 if (!psListLength(where->list) && 144 !psMetadataLookupBool(NULL, config->args, "-all")) { 145 145 psFree(where); 146 146 psError(PXTOOLS_ERR_DATA, false, "search parameters are required"); … … 159 159 psFree(whereClause); 160 160 } 161 psFree(where);162 161 163 162 psString groupby = pxDataGet("stacktool_definebyquery_part2.sql"); 164 163 if (!groupby) { 165 164 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 165 psFree(where); 166 166 return false; 167 167 } … … 202 202 psError(PS_ERR_UNKNOWN, false, "database error"); 203 203 psFree(select); 204 psFree(where); 204 205 return false; 205 206 } … … 217 218 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 218 219 } 219 220 psFree(where); 220 221 return false; 221 222 } … … 223 224 psTrace("stacktool", PS_LOG_INFO, "no rows found"); 224 225 psFree(output); 226 psFree(where); 225 227 return true; 226 228 } … … 228 230 psString insert = NULL; // Insertion query 229 231 if (randomLimit > 0) { 230 insert = pxDataGet("stacktool_definebyquery_insert_random .sql");232 insert = pxDataGet("stacktool_definebyquery_insert_random_part1.sql"); 231 233 } else { 232 234 insert = pxDataGet("stacktool_definebyquery_insert.sql"); … … 234 236 if (!insert) { 235 237 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 236 return false; 238 psFree(where); 239 return false; 240 } 241 242 if (psListLength(where->list)) { 243 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 244 psStringAppend(&select, " AND %s", whereClause); 245 psFree(whereClause); 246 } 247 psFree(where); 248 249 if (randomLimit > 0) { 250 psString part2 = pxDataGet("stacktool_definebyquery_insert_random_part2.sql"); 251 if (!part2) { 252 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 253 psFree(insert); 254 return false; 255 } 256 psStringAppend(&insert, "%s", part2); 257 psFree(part2); 237 258 } 238 259 239 260 if (!psDBTransaction(config->dbh)) { 240 261 psError(PS_ERR_UNKNOWN, false, "database error"); 262 psFree(where); 241 263 return false; 242 264 } … … 288 310 0, // ID 289 311 "new", // state 290 workdir, 312 workdir, 291 313 NULL, // workdir_state 292 registered, 293 skycell_id, 294 tess_id, 314 registered, 315 skycell_id, 316 tess_id, 295 317 filter); 296 318 … … 324 346 psFree(idString); 325 347 326 // XXX this insert uses a select to generate the list of warp_ids for the stack,327 // we have applied a set of criteria above (WHERE) to select the relevant warps328 // this insert needs to use exactly the same restrictions (race condition is probably not critical)329 // the insert below seems to only restrict matches to the skycell, tess, and filter348 // XXX this insert uses a select to generate the list of warp_ids for the stack, 349 // we have applied a set of criteria above (WHERE) to select the relevant warps 350 // this insert needs to use exactly the same restrictions (race condition is probably not critical) 351 // the insert below seems to only restrict matches to the skycell, tess, and filter 330 352 if ((randomLimit > 0 && !p_psDBRunQuery(config->dbh, thisInsert, skycell_id, tess_id, filter, 331 353 randomLimit)) || … … 384 406 385 407 stackRunRow *run = stackRunRowAlloc( 386 0,// ID387 "new",// state388 workdir, 389 NULL,// workdir_state390 registered, 391 skycell_id, 392 tess_id, 393 filter);408 0, // ID 409 "new", // state 410 workdir, 411 NULL, // workdir_state 412 registered, 413 skycell_id, 414 tess_id, 415 filter); 394 416 395 417 if (!run) {
Note:
See TracChangeset
for help on using the changeset viewer.
