Changeset 40109 for trunk/ippTools/src/difftool.c
- Timestamp:
- Aug 9, 2017, 12:05:55 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r38041 r40109 1234 1234 psMetadata *where = psMetadataAlloc(); 1235 1235 1236 PXOPT_LOOKUP_BOOL(lapQuery, config->args, "-lap_query", false); 1237 1236 1238 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 1237 1239 PXOPT_COPY_STR(config->args, where, "-filter", "rawExp.filter", "=="); … … 1245 1247 PXOPT_COPY_STR(config->args, where, "-stack_label", "stackRun.label", "=="); 1246 1248 PXOPT_COPY_STR(config->args, where, "-stack_data_group", "stackRun.data_group", "=="); 1249 1247 1250 1248 1251 // Add position dependence here. … … 1277 1280 1278 1281 // Get query file 1279 psString query = pxDataGet("difftool_definewarpstack.sql"); 1282 psString query; 1283 if (lapQuery) { 1284 query = pxDataGet("difftool_definewarpstack.sql"); 1285 } 1286 else { 1287 query = pxDataGet("difftool_definewarpstack_old.sql"); 1288 } 1289 1280 1290 if (!query) { 1281 1291 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 1284 1294 1285 1295 psString whereClause = psDBGenerateWhereConditionSQL(where,NULL); 1286 psString diffWhereClause = psStringCopy(""); 1287 psString joinWhereClause = psStringCopy(""); 1288 1289 // Don't queue things that already have diffs. 1290 if (! (reRun || newTemplates) ) { 1291 psStringAppend(&joinWhereClause, "\nAND diff_id IS NULL\n"); 1296 psString whereClauseString = psStringCopy(""); 1297 if (lapQuery) { 1298 psString diffWhereClause = psStringCopy(""); 1299 psString joinWhereClause = psStringCopy(""); 1300 1301 // Don't queue things that already have diffs. 1302 if (! (reRun || newTemplates) ) { 1303 psStringAppend(&joinWhereClause, "\nAND diff_id IS NULL\n"); 1304 } 1305 // Append diff qualifiers, if we have them 1306 if (label) { 1307 psStringAppend(&diffWhereClause, "\nAND ((diffRun.label = '%s') OR (diffRun.label IS NULL))",label); 1308 } 1309 if (data_group) { 1310 psStringAppend(&diffWhereClause, "\nAND ((diffRun.data_group = '%s') OR (diffRun.data_group IS NULL))",data_group); 1311 } 1312 if (reduction) { 1313 psStringAppend(&diffWhereClause, "\nAND ((diffRun.reduction = '%s') OR (diffRun.reduction IS NULL))",reduction); 1314 } 1315 1316 psStringAppend(&whereClauseString, " \n AND %s ", whereClause); 1317 // fprintf(stderr,query,whereClauseString); 1318 1319 // This is just a simple query, so we don't need to do a transaction 1320 if (!p_psDBRunQueryF(config->dbh, query, whereClauseString, diffWhereClause,joinWhereClause)) { 1321 psError(PS_ERR_UNKNOWN, false, "database error"); 1322 psFree(query); 1323 psFree(whereClause); 1324 return(false); 1325 } 1326 1327 psFree(diffWhereClause); 1328 psFree(joinWhereClause); 1329 1292 1330 } 1293 // Append diff qualifiers, if we have them 1294 if (label) { 1295 psStringAppend(&diffWhereClause, "\nAND ((diffRun.label = '%s') OR (diffRun.label IS NULL))",label); 1331 else { 1332 // Don't queue things that already have diffs. 1333 if (! (reRun || newTemplates) ) { 1334 psStringAppend(&whereClause, "\nAND diff_id IS NULL\n"); 1335 } 1336 // Append diff qualifiers, if we have them 1337 if (label) { 1338 psStringAppend(&whereClause, "\nAND ((diffRun.label = '%s') OR (diffRun.label IS NULL))",label); 1339 } 1340 if (data_group) { 1341 psStringAppend(&whereClause, "\nAND ((diffRun.data_group = '%s') OR (diffRun.data_group IS NULL))",data_group); 1342 } 1343 if (reduction) { 1344 psStringAppend(&whereClause, "\nAND ((diffRun.reduction = '%s') OR (diffRun.reduction IS NULL))",reduction); 1345 } 1346 1347 psStringAppend(&whereClauseString, " \n AND %s ", whereClause); 1348 if (!p_psDBRunQueryF(config->dbh, query, whereClauseString)) { 1349 psError(PS_ERR_UNKNOWN, false, "database error"); 1350 psFree(query); 1351 psFree(whereClause); 1352 return(false); 1353 } 1354 1296 1355 } 1297 if (data_group) { 1298 psStringAppend(&diffWhereClause, "\nAND ((diffRun.data_group = '%s') OR (diffRun.data_group IS NULL))",data_group); 1299 } 1300 if (reduction) { 1301 psStringAppend(&diffWhereClause, "\nAND ((diffRun.reduction = '%s') OR (diffRun.reduction IS NULL))",reduction); 1302 } 1303 1304 psString whereClauseString = psStringCopy(""); 1305 psStringAppend(&whereClauseString, " \n AND %s ", whereClause); 1306 // fprintf(stderr,query,whereClauseString); 1307 1308 // This is just a simple query, so we don't need to do a transaction 1309 if (!p_psDBRunQueryF(config->dbh, query, whereClauseString, diffWhereClause,joinWhereClause)) { 1310 psError(PS_ERR_UNKNOWN, false, "database error"); 1311 psFree(query); 1312 psFree(whereClause); 1313 return(false); 1314 } 1356 1315 1357 psFree(query); 1316 1358 psFree(whereClause);
Note:
See TracChangeset
for help on using the changeset viewer.
