Changeset 19632 for trunk/ippTools/src/dettool_residimfile.c
- Timestamp:
- Sep 21, 2008, 9:20:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool_residimfile.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool_residimfile.c
r19621 r19632 150 150 151 151 psMetadata *where = psMetadataAlloc(); 152 PXOPT_COPY_S64(config->args, where, "-det_id", "det_id", "=="); 153 PXOPT_COPY_S32(config->args, where, "-iteration", "iteration", "=="); 154 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 155 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 156 PXOPT_COPY_STR(config->args, where, "-recip", "recipe", "=="); 152 PXOPT_COPY_S64(config->args, where, "-det_id", "detResidImfile.det_id", "=="); 153 PXOPT_COPY_S32(config->args, where, "-iteration", "detResidImfile.iteration", "=="); 154 PXOPT_COPY_S64(config->args, where, "-exp_id", "detResidImfile.exp_id", "=="); 155 PXOPT_COPY_STR(config->args, where, "-class_id", "detResidImfile.class_id", "=="); 156 PXOPT_COPY_STR(config->args, where, "-recip", "detResidImfile.recipe", "=="); 157 PXOPT_COPY_STR(config->args, where, "-select_state", "detRun.state", "=="); 157 158 158 159 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); … … 166 167 } 167 168 168 // NOTE: the query ends in a WHERE, add the required restriction on detRun.state 169 char *value = NULL; 170 bool status; 171 if ((value = psMetadataLookupStr(&status, config->args, "-select_state"))) { 172 psStringAppend(&query, " detRun.state = '%s'", value); 169 bool hasWhere = false; 170 if (psListLength(where->list)) { 171 psString whereClause = psDBGenerateWhereSQL(where, NULL); 172 psStringAppend(&query, " %s", whereClause); 173 psFree(whereClause); 174 hasWhere = true; 175 } 176 psFree(where); 177 178 if (hasWhere) { 179 psStringAppend(&query, " AND"); 173 180 } else { 174 psStringAppend(&query, " detRun.state = 'run'"); 175 } 176 177 if (psListLength(where->list)) { 178 psString whereClause = psDBGenerateWhereConditionSQL(where, "detResidImfile"); 179 psStringAppend(&query, " AND %s", whereClause); 180 psFree(whereClause); 181 } 182 psFree(where); 181 psStringAppend(&query, " WHERE"); 182 } 183 183 184 184 if (faulted) { 185 185 // list only faulted rows 186 psStringAppend(&query, " %s", " ANDdetResidImfile.fault != 0");186 psStringAppend(&query, " %s", " detResidImfile.fault != 0"); 187 187 } else { 188 188 // don't list faulted rows 189 psStringAppend(&query, " %s", " ANDdetResidImfile.fault = 0");189 psStringAppend(&query, " %s", " detResidImfile.fault = 0"); 190 190 } 191 191
Note:
See TracChangeset
for help on using the changeset viewer.
