Changeset 21402
- Timestamp:
- Feb 6, 2009, 3:25:03 PM (17 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 22 edited
-
camtool.c (modified) (1 diff)
-
chiptool.c (modified) (3 diffs)
-
dettool.c (modified) (11 diffs)
-
dettool_detrunsummary.c (modified) (1 diff)
-
dettool_processedexp.c (modified) (1 diff)
-
difftool.c (modified) (7 diffs)
-
faketool.c (modified) (3 diffs)
-
flatcorr.c (modified) (6 diffs)
-
magicdstool.c (modified) (6 diffs)
-
magictool.c (modified) (5 diffs)
-
pstamptool.c (modified) (4 diffs)
-
pxcam.c (modified) (5 diffs)
-
pxchip.c (modified) (5 diffs)
-
pxfake.c (modified) (5 diffs)
-
pxregister.c (modified) (1 diff)
-
pxwarp.c (modified) (4 diffs)
-
pzgetexp.c (modified) (1 diff)
-
pzgetimfiles.c (modified) (5 diffs)
-
pztool.c (modified) (2 diffs)
-
regtool.c (modified) (2 diffs)
-
stacktool.c (modified) (2 diffs)
-
warptool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/camtool.c
r20541 r21402 886 886 char *query = "DELETE FROM camMask WHERE label = '%s'"; 887 887 888 if (!p_psDBRunQuery (config->dbh, query, label)) {888 if (!p_psDBRunQueryF(config->dbh, query, label)) { 889 889 psError(PS_ERR_UNKNOWN, false, "database error"); 890 890 return false; -
trunk/ippTools/src/chiptool.c
r21308 r21402 809 809 char *query = "DELETE FROM chipMask WHERE label = '%s'"; 810 810 811 if (!p_psDBRunQuery (config->dbh, query, label)) {811 if (!p_psDBRunQueryF(config->dbh, query, label)) { 812 812 psError(PS_ERR_UNKNOWN, false, "database error"); 813 813 return false; … … 1173 1173 1174 1174 // note only updates if chipRun.state = run_state 1175 if (!p_psDBRunQuery (config->dbh, query, data_state, chip_id, class_id, run_state)) {1175 if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, class_id, run_state)) { 1176 1176 psError(PS_ERR_UNKNOWN, false, "database error"); 1177 1177 // rollback … … 1189 1189 1190 1190 query = pxDataGet("chiptool_change_exp_state.sql"); 1191 if (!p_psDBRunQuery (config->dbh, query, data_state, chip_id, data_state)) {1191 if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, data_state)) { 1192 1192 // rollback 1193 1193 if (!psDBRollback(config->dbh)) { -
trunk/ippTools/src/dettool.c
r19988 r21402 968 968 } 969 969 970 if (!p_psDBRunQuery (config->dbh, query, (long long) newDet_id, (long long) det_id, iteration)) {970 if (!p_psDBRunQueryF(config->dbh, query, (long long) newDet_id, (long long) det_id, iteration)) { 971 971 psError(PS_ERR_UNKNOWN, false, "database error"); 972 972 psFree(query); … … 1733 1733 1734 1734 char *query = "UPDATE detRun SET iteration = iteration + 1 WHERE det_id = %" PRId64; 1735 if (!p_psDBRunQuery (config->dbh, query, det_id)) {1735 if (!p_psDBRunQueryF(config->dbh, query, det_id)) { 1736 1736 psError(PS_ERR_UNKNOWN, false, 1737 1737 "failed to increment iteration for det_id %" PRId64, det_id); … … 1773 1773 1774 1774 char *query = "UPDATE detRun SET state = '%s' WHERE det_id = %" PRId64; 1775 if (!p_psDBRunQuery (config->dbh, query, state, det_id)) {1775 if (!p_psDBRunQueryF(config->dbh, query, state, det_id)) { 1776 1776 psError(PS_ERR_UNKNOWN, false, "failed to change state for det_id %" PRId64, det_id); 1777 1777 return false; … … 1835 1835 " AND exp_id = %" PRId64 1836 1836 " AND class_id = '%s'"; 1837 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, exp_id, class_id)) {1837 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, exp_id, class_id)) { 1838 1838 psError(PS_ERR_UNKNOWN, false, 1839 1839 "failed to change state for det_id %" PRId64 ", exp_id %" PRId64 ", class_id %s", … … 1855 1855 " WHERE det_id = %" PRId64 1856 1856 " AND exp_id = %" PRId64; 1857 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, exp_id)) {1857 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, exp_id)) { 1858 1858 psError(PS_ERR_UNKNOWN, false, 1859 1859 "failed to change state for det_id %" PRId64 ", exp_id %" PRId64, … … 1878 1878 " AND iteration = %" PRId32 1879 1879 " AND class_id = %s"; 1880 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, iteration, class_id)) {1880 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, iteration, class_id)) { 1881 1881 psError(PS_ERR_UNKNOWN, false, 1882 1882 "failed to change state for det_id %" PRId64 ", iteration %" PRId32 "class_id %s", … … 1900 1900 " AND iteration = %" PRId32 1901 1901 " AND class_id = %s"; 1902 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, iteration)) {1902 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, iteration)) { 1903 1903 psError(PS_ERR_UNKNOWN, false, 1904 1904 "failed to change state for det_id %" PRId64 ", iteration %" PRId32, … … 1922 1922 " AND iteration = %" PRId32 1923 1923 " AND class_id = %s"; 1924 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, iteration, class_id)) {1924 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, iteration, class_id)) { 1925 1925 psError(PS_ERR_UNKNOWN, false, 1926 1926 "failed to change state for det_id %" PRId64 ", iteration %" PRId32 " class %s", … … 1942 1942 " WHERE det_id = %" PRId64 1943 1943 " AND iteration = %" PRId32; 1944 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, iteration)) {1944 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, iteration)) { 1945 1945 psError(PS_ERR_UNKNOWN, false, 1946 1946 "failed to change state for det_id %" PRId64 ", iteration %" PRId32, … … 1965 1965 " AND exp_id = %" PRId64 1966 1966 " AND class_id = '%s'"; 1967 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, iteration, exp_id, class_id)) {1967 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, iteration, exp_id, class_id)) { 1968 1968 psError(PS_ERR_UNKNOWN, false, 1969 1969 "failed to change state for det_id %" PRId64 ", iteration %" PRId32 ", exp_id %" PRId64 ", class_id %s", … … 1986 1986 " AND iteration = %" PRId32 1987 1987 " AND exp_id = %" PRId64; 1988 if (!p_psDBRunQuery (config->dbh, query, data_state, det_id, iteration, exp_id)) {1988 if (!p_psDBRunQueryF(config->dbh, query, data_state, det_id, iteration, exp_id)) { 1989 1989 psError(PS_ERR_UNKNOWN, false, 1990 1990 "failed to change state for det_id %" PRId64 ", iteration %" PRId32 ", exp_id %" PRId64, -
trunk/ippTools/src/dettool_detrunsummary.c
r19092 r21402 356 356 357 357 char *query = "UPDATE detRunSummary SET accept = %d WHERE det_id = %"PRId64; 358 if (!p_psDBRunQuery (config->dbh, query, accept, det_id)) {359 psError(PS_ERR_UNKNOWN, false, "database error"); 360 return false; 361 } 362 363 return true; 364 } 365 366 358 if (!p_psDBRunQueryF(config->dbh, query, accept, det_id)) { 359 psError(PS_ERR_UNKNOWN, false, "database error"); 360 return false; 361 } 362 363 return true; 364 } 365 366 -
trunk/ippTools/src/dettool_processedexp.c
r19092 r21402 105 105 } 106 106 107 if (!p_psDBRunQuery (config->dbh, query, (long long) det_id, (long long) exp_id)) {107 if (!p_psDBRunQueryF(config->dbh, query, (long long) det_id, (long long) exp_id)) { 108 108 psError(PS_ERR_UNKNOWN, false, "database error"); 109 109 psFree(query); -
trunk/ippTools/src/difftool.c
r21399 r21402 207 207 psString tess_id = NULL; 208 208 if (warp1) { 209 if (!p_psDBRunQuery (config->dbh, "SELECT * from diffRun WHERE diff_id = %" PRId64, diff_id)) {209 if (!p_psDBRunQueryF(config->dbh, "SELECT * from diffRun WHERE diff_id = %" PRId64, diff_id)) { 210 210 psError(PS_ERR_UNKNOWN, false, "database error"); 211 211 return false; … … 249 249 } 250 250 251 if (!p_psDBRunQuery (config->dbh, "SELECT count(diff_id) FROM diffRun JOIN diffInputSkyfile USING(diff_id) WHERE diff_id = %" PRId64, diff_id)) {251 if (!p_psDBRunQueryF(config->dbh, "SELECT count(diff_id) FROM diffRun JOIN diffInputSkyfile USING(diff_id) WHERE diff_id = %" PRId64, diff_id)) { 252 252 if (!psDBRollback(config->dbh)) { 253 253 psError(PS_ERR_UNKNOWN, false, "database error"); … … 355 355 } 356 356 357 if (!p_psDBRunQuery (config->dbh, query, whereClause, whereClause, whereClause, whereClause)) {357 if (!p_psDBRunQueryF(config->dbh, query, whereClause, whereClause, whereClause, whereClause)) { 358 358 psError(PS_ERR_UNKNOWN, false, "database error"); 359 359 psFree(whereClause); … … 737 737 738 738 char *query = "UPDATE diffRun SET state = '%s' WHERE diff_id = %"PRId64; 739 if (!p_psDBRunQuery (config->dbh, query, state, diff_id)) {739 if (!p_psDBRunQueryF(config->dbh, query, state, diff_id)) { 740 740 psError(PS_ERR_UNKNOWN, false, 741 741 "failed to change state for diff_id %"PRId64, diff_id); … … 829 829 830 830 char *query = "UPDATE diffRun SET state = 'new' WHERE diff_id = '%" PRId64 "'"; 831 if (!p_psDBRunQuery (config->dbh, query, run->diff_id)) {831 if (!p_psDBRunQueryF(config->dbh, query, run->diff_id)) { 832 832 if (!psDBRollback(config->dbh)) { 833 833 psError(PS_ERR_UNKNOWN, false, "database error"); … … 999 999 1000 1000 1001 if (!p_psDBRunQuery (config->dbh, query, warpQuery, expQuery, diffQuery)) {1001 if (!p_psDBRunQueryF(config->dbh, query, warpQuery, expQuery, diffQuery)) { 1002 1002 psError(PS_ERR_UNKNOWN, false, "database error"); 1003 1003 psFree(query); … … 1098 1098 return false; 1099 1099 } 1100 if (!p_psDBRunQuery (config->dbh, skycell_query, stackQuery, warp_id, filter, warpQuery)) {1100 if (!p_psDBRunQueryF(config->dbh, skycell_query, stackQuery, warp_id, filter, warpQuery)) { 1101 1101 psError(PS_ERR_UNKNOWN, false, "database error"); 1102 1102 psFree(warpQuery); -
trunk/ippTools/src/faketool.c
r20748 r21402 868 868 char *query = "DELETE FROM fakeMask WHERE label = '%s'"; 869 869 870 if (!p_psDBRunQuery (config->dbh, query, label)) {870 if (!p_psDBRunQueryF(config->dbh, query, label)) { 871 871 psError(PS_ERR_UNKNOWN, false, "database error"); 872 872 return false; … … 1155 1155 1156 1156 // note only updates if fakeRun.state = run_state 1157 if (!p_psDBRunQuery (config->dbh, query, data_state, fake_id, class_id, run_state)) {1157 if (!p_psDBRunQueryF(config->dbh, query, data_state, fake_id, class_id, run_state)) { 1158 1158 psError(PS_ERR_UNKNOWN, false, "database error"); 1159 1159 // rollback … … 1172 1172 1173 1173 query = pxDataGet("faketool_change_exp_state.sql"); 1174 if (!p_psDBRunQuery (config->dbh, query, data_state, fake_id, data_state)) {1174 if (!p_psDBRunQueryF(config->dbh, query, data_state, fake_id, data_state)) { 1175 1175 // rollback 1176 1176 if (!psDBRollback(config->dbh)) { -
trunk/ippTools/src/flatcorr.c
r20397 r21402 365 365 } 366 366 367 if (!p_psDBRunQuery (config->dbh, query, (long long) corr_id, (long long) chip_id)) {367 if (!p_psDBRunQueryF(config->dbh, query, (long long) corr_id, (long long) chip_id)) { 368 368 psError(PS_ERR_UNKNOWN, false, "database error"); 369 369 psFree(query); … … 513 513 } 514 514 515 if (!p_psDBRunQuery (config->dbh, query, (long long) corr_id, (long long) cam_id)) {515 if (!p_psDBRunQueryF(config->dbh, query, (long long) corr_id, (long long) cam_id)) { 516 516 psError(PS_ERR_UNKNOWN, false, "database error"); 517 517 psFree(query); … … 589 589 } 590 590 591 if (!p_psDBRunQuery (config->dbh, query, corr_id)) {591 if (!p_psDBRunQueryF(config->dbh, query, corr_id)) { 592 592 psError(PS_ERR_UNKNOWN, false, "database error"); 593 593 psFree(query); … … 648 648 } 649 649 650 if (!p_psDBRunQuery (config->dbh, query, chip_id)) {650 if (!p_psDBRunQueryF(config->dbh, query, chip_id)) { 651 651 psError(PS_ERR_UNKNOWN, false, "database error"); 652 652 psFree(query); … … 685 685 char *query = "UPDATE flatcorrRun SET state = 'full', hostname = '%s', fault = '%hd' WHERE corr_id = %" PRId64; 686 686 687 if (!p_psDBRunQuery (config->dbh, query, hostname, code, corr_id)) {687 if (!p_psDBRunQueryF(config->dbh, query, hostname, code, corr_id)) { 688 688 psError(PS_ERR_UNKNOWN, false, "failed to change state for corr_id %" PRId64, corr_id); 689 689 return false; … … 727 727 char *query = "UPDATE flatcorrRun SET state = '%s' WHERE corr_id = %" PRId64; 728 728 729 if (!p_psDBRunQuery (config->dbh, query, state, corr_id)) {729 if (!p_psDBRunQueryF(config->dbh, query, state, corr_id)) { 730 730 psError(PS_ERR_UNKNOWN, false, "failed to change state for corr_id %" PRId64, corr_id); 731 731 return false; -
trunk/ippTools/src/magicdstool.c
r20973 r21402 159 159 psFree(where); 160 160 161 if (!p_psDBRunQuery (config->dbh, query, whereClause)) {161 if (!p_psDBRunQueryF(config->dbh, query, whereClause)) { 162 162 psError(PS_ERR_UNKNOWN, false, "database error"); 163 163 psFree(whereClause); … … 215 215 216 216 217 if (!p_psDBRunQuery (config->dbh, query, magicSkyCellNumsWhere ? magicSkyCellNumsWhere : "")) {217 if (!p_psDBRunQueryF(config->dbh, query, magicSkyCellNumsWhere ? magicSkyCellNumsWhere : "")) { 218 218 psError(PS_ERR_UNKNOWN, false, "database error"); 219 219 psFree(magicSkyCellNumsWhere); … … 298 298 } 299 299 300 if (!p_psDBRunQuery (config->dbh, thisInsert, magic_id, exp_id)) {300 if (!p_psDBRunQueryF(config->dbh, thisInsert, magic_id, exp_id)) { 301 301 psError(PS_ERR_UNKNOWN, false, "database error"); 302 302 psFree(thisInsert); … … 560 560 } 561 561 562 if (!p_psDBRunQuery (config->dbh, query, magic_id)) {562 if (!p_psDBRunQueryF(config->dbh, query, magic_id)) { 563 563 psError(PS_ERR_UNKNOWN, false, "database error"); 564 564 psFree(query); … … 692 692 psFree(where); 693 693 694 if (!p_psDBRunQuery (config->dbh, query, magic_ds_id)) {694 if (!p_psDBRunQueryF(config->dbh, query, magic_ds_id)) { 695 695 psError(PS_ERR_UNKNOWN, false, "database error"); 696 696 psFree(query); … … 749 749 750 750 char *query = "UPDATE magicDSRun SET state = '%s' WHERE magic_ds_id = %" PRId64; 751 if (!p_psDBRunQuery (config->dbh, query, state, magic_ds_id)) {751 if (!p_psDBRunQueryF(config->dbh, query, state, magic_ds_id)) { 752 752 psError(PS_ERR_UNKNOWN, false, 753 753 "failed to change state for magic_id %" PRId64, magic_ds_id); -
trunk/ippTools/src/magictool.c
r21099 r21402 171 171 } 172 172 173 if (!p_psDBRunQuery (config->dbh, query, queryWhere)) {173 if (!p_psDBRunQueryF(config->dbh, query, queryWhere)) { 174 174 psError(PS_ERR_UNKNOWN, false, "database error"); 175 175 psFree(queryWhere); … … 255 255 } 256 256 257 if (!p_psDBRunQuery (config->dbh, thisInsert, magic_id, exp_id)) {257 if (!p_psDBRunQueryF(config->dbh, thisInsert, magic_id, exp_id)) { 258 258 psError(PS_ERR_UNKNOWN, false, "database error"); 259 259 psFree(thisInsert); … … 539 539 if (code > 0) { 540 540 char *query = "UPDATE magicRun SET fault = %d, state = 'stop' WHERE magic_id = %" PRId64; 541 if (!p_psDBRunQuery (config->dbh, query, code, magic_id)) {541 if (!p_psDBRunQueryF(config->dbh, query, code, magic_id)) { 542 542 psError(PS_ERR_UNKNOWN, false, 543 543 "failed to set fault for magic_id %" PRId64, magic_id); … … 795 795 whereClause = new; 796 796 } 797 if (!p_psDBRunQuery (config->dbh, query, whereClause ? whereClause : "")) {797 if (!p_psDBRunQueryF(config->dbh, query, whereClause ? whereClause : "")) { 798 798 psError(PS_ERR_UNKNOWN, false, "database error"); 799 799 psFree(whereClause); … … 1492 1492 1493 1493 char *query = "UPDATE magicRun SET state = '%s' WHERE magic_id = %" PRId64; 1494 if (!p_psDBRunQuery (config->dbh, query, state, magic_id)) {1494 if (!p_psDBRunQueryF(config->dbh, query, state, magic_id)) { 1495 1495 psError(PS_ERR_UNKNOWN, false, 1496 1496 "failed to change state for magic_id %" PRId64, magic_id); -
trunk/ippTools/src/pstamptool.c
r20151 r21402 231 231 " (state, uri, ds_id, fault)" 232 232 " VALUES( 'new', '%s', %" PRId64 ", 0 )"; 233 if (!p_psDBRunQuery (config->dbh, query, uri, ds_id)) {233 if (!p_psDBRunQueryF(config->dbh, query, uri, ds_id)) { 234 234 psError(PS_ERR_UNKNOWN, false, "database error"); 235 235 return false; … … 480 480 // printf("Revert request %" PRId64 "\n", req_id); 481 481 482 if (!p_psDBRunQuery (config->dbh, "DELETE FROM pstampJob where req_id = %" PRId64, req_id)) {483 psError(PS_ERR_UNKNOWN, false, "database error"); 484 return false; 485 } 486 if (!p_psDBRunQuery (config->dbh,482 if (!p_psDBRunQueryF(config->dbh, "DELETE FROM pstampJob where req_id = %" PRId64, req_id)) { 483 psError(PS_ERR_UNKNOWN, false, "database error"); 484 return false; 485 } 486 if (!p_psDBRunQueryF(config->dbh, 487 487 "UPDATE pstampRequest set state ='new', name=NULL, reqType=NULL, fault=0 where req_id = %" PRId64, req_id)) { 488 488 psError(PS_ERR_UNKNOWN, false, "database error"); … … 535 535 } 536 536 537 if (!p_psDBRunQuery (config->dbh, query, req_id, rownum, stateString, job_type, uri, exp_id, outputBase, fault, argString)) {537 if (!p_psDBRunQueryF(config->dbh, query, req_id, rownum, stateString, job_type, uri, exp_id, outputBase, fault, argString)) { 538 538 psError(PS_ERR_UNKNOWN, false, "database error"); 539 539 return false; … … 705 705 " WHERE job_id = %" PRId64; 706 706 707 if (!p_psDBRunQuery (config->dbh, query, state, faultStr, job_id)) {707 if (!p_psDBRunQueryF(config->dbh, query, state, faultStr, job_id)) { 708 708 psError(PS_ERR_UNKNOWN, false, "database error"); 709 709 psFree(query); -
trunk/ippTools/src/pxcam.c
r20542 r21402 134 134 135 135 char *query = "UPDATE camRun SET state = '%s' WHERE cam_id = %" PRId64; 136 if (!p_psDBRunQuery (config->dbh, query, state, cam_id)) {136 if (!p_psDBRunQueryF(config->dbh, query, state, cam_id)) { 137 137 psError(PS_ERR_UNKNOWN, false, 138 138 "failed to change state for cam_id %" PRId64, cam_id); … … 164 164 } 165 165 166 if (!p_psDBRunQuery (config->dbh, query, state)) {166 if (!p_psDBRunQueryF(config->dbh, query, state)) { 167 167 psFree(query); 168 168 psError(PS_ERR_UNKNOWN, false, "database error"); … … 182 182 183 183 char *query = "UPDATE camRun SET camRun.label = '%s' WHERE cam_id = %" PRId64; 184 if (!p_psDBRunQuery (config->dbh, query, label, cam_id)) {184 if (!p_psDBRunQueryF(config->dbh, query, label, cam_id)) { 185 185 psError(PS_ERR_UNKNOWN, false, 186 186 "failed to change state for cam_id %" PRId64, cam_id); … … 204 204 } 205 205 206 if (!p_psDBRunQuery (config->dbh, query, label)) {206 if (!p_psDBRunQueryF(config->dbh, query, label)) { 207 207 psFree(query); 208 208 psError(PS_ERR_UNKNOWN, false, "database error"); … … 242 242 // XXX chip_id is being cast here work around psS64 have a different type 243 243 // different on 32/64 244 if (!p_psDBRunQuery (config->dbh, query,244 if (!p_psDBRunQueryF(config->dbh, query, 245 245 "new", // state 246 246 workdir ? workdir : "NULL", -
trunk/ippTools/src/pxchip.c
r21308 r21402 140 140 141 141 char *query = "UPDATE chipRun SET state = '%s' WHERE chip_id = %" PRId64; 142 if (!p_psDBRunQuery (config->dbh, query, state, chip_id)) {142 if (!p_psDBRunQueryF(config->dbh, query, state, chip_id)) { 143 143 psError(PS_ERR_UNKNOWN, false, 144 144 "failed to change state for chip_id %" PRId64, chip_id); … … 170 170 } 171 171 172 if (!p_psDBRunQuery (config->dbh, query, state)) {172 if (!p_psDBRunQueryF(config->dbh, query, state)) { 173 173 psFree(query); 174 174 psError(PS_ERR_UNKNOWN, false, "database error"); … … 188 188 189 189 char *query = "UPDATE chipRun SET label = '%s' WHERE chip_id = %" PRId64; 190 if (!p_psDBRunQuery (config->dbh, query, label, chip_id)) {190 if (!p_psDBRunQueryF(config->dbh, query, label, chip_id)) { 191 191 psError(PS_ERR_UNKNOWN, false, 192 192 "failed to change state for chip_id %" PRId64, chip_id); … … 211 211 } 212 212 213 if (!p_psDBRunQuery (config->dbh, query, label)) {213 if (!p_psDBRunQueryF(config->dbh, query, label)) { 214 214 psFree(query); 215 215 psError(PS_ERR_UNKNOWN, false, "database error"); … … 269 269 "SELECT %" PRId64 ", class_id, 0 FROM rawImfile WHERE exp_id = %" PRId64; 270 270 271 if (!p_psDBRunQuery (config->dbh, query, chip_id, exp_id)) {271 if (!p_psDBRunQueryF(config->dbh, query, chip_id, exp_id)) { 272 272 psError(PS_ERR_UNKNOWN, false, "database error"); 273 273 // rollback -
trunk/ippTools/src/pxfake.c
r21097 r21402 42 42 43 43 char *query = "UPDATE fakeRun SET state = '%s' WHERE fake_id = %" PRId64; 44 if (!p_psDBRunQuery (config->dbh, query, state, fake_id)) {44 if (!p_psDBRunQueryF(config->dbh, query, state, fake_id)) { 45 45 psError(PS_ERR_UNKNOWN, false, 46 46 "failed to change state for fake_id %" PRId64, fake_id); … … 72 72 } 73 73 74 if (!p_psDBRunQuery (config->dbh, query, state)) {74 if (!p_psDBRunQueryF(config->dbh, query, state)) { 75 75 psFree(query); 76 76 psError(PS_ERR_UNKNOWN, false, "database error"); … … 90 90 91 91 char *query = "UPDATE fakeRun SET fakeRun.label = '%s' WHERE fake_id = %" PRId64; 92 if (!p_psDBRunQuery (config->dbh, query, label, fake_id)) {92 if (!p_psDBRunQueryF(config->dbh, query, label, fake_id)) { 93 93 psError(PS_ERR_UNKNOWN, false, 94 94 "failed to change state for fake_id %" PRId64, fake_id); … … 113 113 } 114 114 115 if (!p_psDBRunQuery (config->dbh, query, label)) {115 if (!p_psDBRunQueryF(config->dbh, query, label)) { 116 116 psFree(query); 117 117 psError(PS_ERR_UNKNOWN, false, "database error"); … … 153 153 // XXX chip_id is being cast here work around psS64 have a different type 154 154 // different on 32/64 155 if (!p_psDBRunQuery (config->dbh, query,155 if (!p_psDBRunQueryF(config->dbh, query, 156 156 "new", // state 157 157 workdir ? workdir : "NULL", -
trunk/ippTools/src/pxregister.c
r18336 r21402 50 50 51 51 char *query = "UPDATE newExp SET state = '%s' WHERE exp_id = %"PRId64; 52 if (!p_psDBRunQuery (config->dbh, query, state, exp_id)) {52 if (!p_psDBRunQueryF(config->dbh, query, state, exp_id)) { 53 53 psError(PS_ERR_UNKNOWN, false, 54 54 "failed to change state for exp_id %"PRId64, exp_id); -
trunk/ippTools/src/pxwarp.c
r20973 r21402 41 41 42 42 char *query = "UPDATE warpRun SET state = '%s' WHERE warp_id = %" PRId64; 43 if (!p_psDBRunQuery (config->dbh, query, state, warp_id)) {43 if (!p_psDBRunQueryF(config->dbh, query, state, warp_id)) { 44 44 psError(PS_ERR_UNKNOWN, false, 45 45 "failed to change state for warp_id %" PRId64, warp_id); … … 72 72 } 73 73 74 if (!p_psDBRunQuery (config->dbh, query, state)) {74 if (!p_psDBRunQueryF(config->dbh, query, state)) { 75 75 psFree(query); 76 76 psError(PS_ERR_UNKNOWN, false, "database error"); … … 90 90 91 91 char *query = "UPDATE warpRun SET warpRun.label = '%s' WHERE warp_id = %" PRId64; 92 if (!p_psDBRunQuery (config->dbh, query, label, warp_id)) {92 if (!p_psDBRunQueryF(config->dbh, query, label, warp_id)) { 93 93 psError(PS_ERR_UNKNOWN, false, 94 94 "failed to change label for warp_id %" PRId64, warp_id); … … 113 113 } 114 114 115 if (!p_psDBRunQuery (config->dbh, query, label)) {115 if (!p_psDBRunQueryF(config->dbh, query, label)) { 116 116 psFree(query); 117 117 psError(PS_ERR_UNKNOWN, false, "database error"); -
trunk/ippTools/src/pzgetexp.c
r18928 r21402 85 85 if (!all) { 86 86 char *query = "SELECT * from summitExp WHERE camera = \"%s\" and TELESCOPE = \"%s\" ORDER BY dateobs DESC LIMIT 1"; 87 if (!p_psDBRunQuery (config->dbh, query, camera, telescope)) {87 if (!p_psDBRunQueryF(config->dbh, query, camera, telescope)) { 88 88 psError(PS_ERR_UNKNOWN, false, "database error"); 89 89 return false; -
trunk/ippTools/src/pzgetimfiles.c
r20813 r21402 101 101 if (status != 0) { 102 102 // mark the summitExp row as faulted 103 if (!p_psDBRunQuery (config->dbh, "UPDATE summitExp SET fault = %d WHERE exp_name = '%s' AND camera = '%s' AND telescope = '%s'", WEXITSTATUS(status), filesetid, camera, telescope)) {103 if (!p_psDBRunQueryF(config->dbh, "UPDATE summitExp SET fault = %d WHERE exp_name = '%s' AND camera = '%s' AND telescope = '%s'", WEXITSTATUS(status), filesetid, camera, telescope)) { 104 104 psError(PS_ERR_UNKNOWN, false, "database error"); 105 105 } … … 117 117 // download an "empty" fileset. 118 118 // mark the summitExp row as faulted 119 if (!p_psDBRunQuery (config->dbh, "UPDATE summitExp SET fault = %d WHERE exp_name = '%s' AND camera = '%s' AND telescope = '%s'", 250, filesetid, camera, telescope)) {119 if (!p_psDBRunQueryF(config->dbh, "UPDATE summitExp SET fault = %d WHERE exp_name = '%s' AND camera = '%s' AND telescope = '%s'", 250, filesetid, camera, telescope)) { 120 120 psError(PS_ERR_UNKNOWN, false, "database error"); 121 121 } … … 145 145 " AND camera = '%s'" 146 146 " AND telescope = '%s'"; 147 if (!p_psDBRunQuery (config->dbh, query, imfiles, filesetid, camera, telescope)) {147 if (!p_psDBRunQueryF(config->dbh, query, imfiles, filesetid, camera, telescope)) { 148 148 // rollback 149 149 if (!psDBRollback(config->dbh)) { … … 162 162 " AND camera = '%s'" 163 163 " AND telescope = '%s'"; 164 if (!p_psDBRunQuery (config->dbh, query, filesetid, camera, telescope)) {164 if (!p_psDBRunQueryF(config->dbh, query, filesetid, camera, telescope)) { 165 165 // rollback 166 166 if (!psDBRollback(config->dbh)) { … … 281 281 " AND telescope = '%s'" 282 282 " AND imfiles IS NULL"; 283 if (!p_psDBRunQuery (config->dbh, query, filesetid, camera, telescope, filesetid, camera, telescope)) {283 if (!p_psDBRunQueryF(config->dbh, query, filesetid, camera, telescope, filesetid, camera, telescope)) { 284 284 // rollback 285 285 if (!psDBRollback(config->dbh)) { -
trunk/ippTools/src/pztool.c
r20310 r21402 592 592 " AND pzDownloadImfile.telescope = '%s'"; 593 593 594 if (!p_psDBRunQuery (config->dbh, query, exp_id, doneExp->exp_name, doneExp->camera, doneExp->telescope)) {594 if (!p_psDBRunQueryF(config->dbh, query, exp_id, doneExp->exp_name, doneExp->camera, doneExp->telescope)) { 595 595 psError(PS_ERR_UNKNOWN, false, "database error"); 596 596 psFree(doneExp); … … 915 915 916 916 char *query = "UPDATE pzDownloadExp SET state = '%s' WHERE exp_name = '%s' and camera = '%s' and telescope = '%s'"; 917 if (!p_psDBRunQuery (config->dbh, query, state, exp_name, camera, telescope)) {917 if (!p_psDBRunQueryF(config->dbh, query, state, exp_name, camera, telescope)) { 918 918 psError(PS_ERR_UNKNOWN, false, "failed to change state for %s:%s:%s", exp_name, camera, telescope); 919 919 return false; -
trunk/ippTools/src/regtool.c
r20973 r21402 481 481 482 482 // 1st arg: where hook, 2nd arg: limit hook 483 if (!p_psDBRunQuery (config->dbh, query, "", limitString ? limitString : "")) {483 if (!p_psDBRunQueryF(config->dbh, query, "", limitString ? limitString : "")) { 484 484 // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms) 485 485 psError(PXTOOLS_ERR_PROG, false, "database error"); … … 630 630 631 631 // 1st arg: where hook, 2nd arg: limit hook 632 if (!p_psDBRunQuery (config->dbh, query, whereClause ? whereClause : "", "")) {632 if (!p_psDBRunQueryF(config->dbh, query, whereClause ? whereClause : "", "")) { 633 633 psError(PS_ERR_UNKNOWN, false, "database error"); 634 634 psFree(whereClause); -
trunk/ippTools/src/stacktool.c
r19931 r21402 358 358 // this insert needs to use exactly the same restrictions (race condition is probably not critical) 359 359 // the insert below seems to only restrict matches to the skycell, tess, and filter 360 if ((randomLimit > 0 && !p_psDBRunQuery (config->dbh, thisInsert, skycell_id, filter, randomLimit)) ||361 (randomLimit <= 0 && !p_psDBRunQuery (config->dbh, thisInsert, skycell_id, filter))) {360 if ((randomLimit > 0 && !p_psDBRunQueryF(config->dbh, thisInsert, skycell_id, filter, randomLimit)) || 361 (randomLimit <= 0 && !p_psDBRunQueryF(config->dbh, thisInsert, skycell_id, filter))) { 362 362 psError(PS_ERR_UNKNOWN, false, "database error"); 363 363 psFree(thisInsert); … … 968 968 969 969 char *query = "UPDATE stackRun SET state = '%s' WHERE stack_id = %"PRId64; 970 if (!p_psDBRunQuery (config->dbh, query, state, stack_id)) {970 if (!p_psDBRunQueryF(config->dbh, query, state, stack_id)) { 971 971 psError(PS_ERR_UNKNOWN, false, 972 972 "failed to change state for stack_id %"PRId64, stack_id); -
trunk/ippTools/src/warptool.c
r21308 r21402 746 746 psS64 warp_id = item->data.S64; 747 747 748 if (!p_psDBRunQuery (config->dbh, query, warp_id, skycell_id)) {748 if (!p_psDBRunQueryF(config->dbh, query, warp_id, skycell_id)) { 749 749 psError(PS_ERR_UNKNOWN, false, "database error"); 750 750 return false; … … 1385 1385 char *query = "DELETE FROM warpMask WHERE label = '%s'"; 1386 1386 1387 if (!p_psDBRunQuery (config->dbh, query, label)) {1387 if (!p_psDBRunQueryF(config->dbh, query, label)) { 1388 1388 psError(PS_ERR_UNKNOWN, false, "database error"); 1389 1389 return false; … … 1620 1620 1621 1621 // note only updates if warpRun.state = run_state 1622 if (!p_psDBRunQuery (config->dbh, query, data_state, warp_id, skycell_id, run_state)) {1622 if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id, run_state)) { 1623 1623 psError(PS_ERR_UNKNOWN, false, "database error"); 1624 1624 // rollback … … 1632 1632 1633 1633 query = pxDataGet("warptool_change_run_state.sql"); 1634 if (!p_psDBRunQuery (config->dbh, query, data_state, warp_id, data_state)) {1634 if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, data_state)) { 1635 1635 // rollback 1636 1636 if (!psDBRollback(config->dbh)) { … … 1672 1672 psString query = pxDataGet("warptool_updateskyfile.sql"); 1673 1673 1674 if (!p_psDBRunQuery (config->dbh, query, code, warp_id, skycell_id)) {1674 if (!p_psDBRunQueryF(config->dbh, query, code, warp_id, skycell_id)) { 1675 1675 psError(PS_ERR_UNKNOWN, false, "database error"); 1676 1676 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
