Changeset 37384 for trunk/ippTools/src/stacktool.c
- Timestamp:
- Sep 10, 2014, 4:53:47 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/stacktool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/stacktool.c
r37104 r37384 41 41 static bool sumskyfileMode(pxConfig *config); 42 42 static bool sassskyfileMode(pxConfig *config); 43 static bool updatesassMode(pxConfig *config); 43 44 static bool revertsumskyfileMode(pxConfig *config); 44 45 static bool tosummaryMode(pxConfig *config); … … 82 83 MODECASE(STACKTOOL_MODE_ADDSUMSKYFILE, addsumskyfileMode); 83 84 MODECASE(STACKTOOL_MODE_SUMSKYFILE, sumskyfileMode); 84 MODECASE(STACKTOOL_MODE_SASSSKYFILE, sassskyfileMode); 85 MODECASE(STACKTOOL_MODE_SASSSKYFILE, sassskyfileMode); 86 MODECASE(STACKTOOL_MODE_UPDATESASS, updatesassMode); 85 87 MODECASE(STACKTOOL_MODE_REVERTSUMSKYFILE, revertsumskyfileMode); 86 88 MODECASE(STACKTOOL_MODE_TOSUMMARY, tosummaryMode); … … 1295 1297 PXOPT_COPY_STR(config->args, where, "-data_group", "stackAssociation.data_group", "LIKE"); 1296 1298 1297 // The following three selectors are incompatible with the sql so omit them1298 // PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "==");1299 // PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");1300 // PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");1301 1302 1299 PXOPT_LOOKUP_BOOL(all, config->args, "-all", false); 1303 1300 … … 1369 1366 } 1370 1367 1368 static bool updatesassMode(pxConfig *config) 1369 { 1370 PS_ASSERT_PTR_NON_NULL(config, false); 1371 1372 psMetadata *where = psMetadataAlloc(); 1373 PXOPT_COPY_S64(config->args, where, "-sass_id", "sass_id", "=="); 1374 PXOPT_COPY_STR(config->args, where, "-data_group", "data_group", "=="); 1375 PXOPT_COPY_STR(config->args, where, "-projection_cell", "projection_cell", "=="); 1376 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 1377 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "=="); 1378 if (!psListLength(where->list)) { 1379 psFree(where); 1380 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 1381 return false; 1382 } 1383 1384 psMetadata *values = psMetadataAlloc(); 1385 PXOPT_COPY_STR(config->args, values, "-set_data_group", "data_group", "=="); 1386 if (!psListLength(values->list)) { 1387 psFree(values); 1388 psError(PXTOOLS_ERR_CONFIG, false, "data_group to assign not found"); 1389 return false; 1390 } 1391 1392 if (!psDBTransaction(config->dbh)) { 1393 psError(PS_ERR_UNKNOWN, false, "database error"); 1394 return false; 1395 } 1396 1397 long rows = psDBUpdateRows(config->dbh, "stackAssociation", where, values); 1398 psFree(values); 1399 psFree(where); 1400 1401 if (rows != 1) { 1402 psError(PS_ERR_UNKNOWN, false, "should have updated only one row. updated %ld", rows); 1403 return false; 1404 } 1405 1406 if (!psDBCommit(config->dbh)) { 1407 psError(PS_ERR_UNKNOWN, false, "database error"); 1408 return false; 1409 } 1410 1411 return true; 1412 } 1371 1413 1372 1414 static bool revertsumskyfileMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
