- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/pxadmin.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/ippTools/src
- Property svn:ignore
-
old new 1 *.la 2 *.lo 1 3 .deps 2 4 .gdb_history … … 4 6 Makefile 5 7 Makefile.in 8 addtool 9 caltool 10 camtool 11 chiptool 6 12 config.h 7 13 config.h.in 8 stamp-h1 9 *.la 10 *.lo 14 detselect 15 dettool 16 difftool 17 disttool 18 dqstatstool 19 faketool 20 flatcorr 21 guidetool 22 magicdstool 23 magictool 24 pstamptool 25 pubtool 26 pxadmin 27 pxdata.c 28 pxinject 11 29 pxtoolsErrorCodes.c 12 30 pxtoolsErrorCodes.h 13 pxadmin14 pxinject15 pztool16 31 pzgetexp 17 32 pzgetimfiles 33 pztool 34 receivetool 18 35 regtool 19 guidetool 20 chiptool 21 camtool 36 stacktool 37 stamp-h1 22 38 warptool 23 difftool24 stacktool25 faketool26 dettool27 detselect28 pxdata.c29 magictool30 magicdstool31 caltool32 flatcorr33 pstamptool34 disttool35 receivetool36 37 pubtool
-
- Property svn:ignore
-
branches/simtest_nebulous_branches/ippTools/src/pxadmin.c
r23310 r27840 2 2 * pxadmin.c 3 3 * 4 * Copyright (C) 2006-200 8Joshua Hoblitt4 * Copyright (C) 2006-2009 Joshua Hoblitt 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify it … … 31 31 bool createMirrorMode(pxConfig *config); 32 32 bool deleteMode(pxConfig *config); 33 static bool insert_dbversion(pxConfig * config, const char *versionString); 33 34 static bool runMultipleStatments(pxConfig *config, const char *query); 34 35 … … 93 94 psString query = pxDataGet("pxadmin_create_tables.sql"); 94 95 if (!query) { 95 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");96 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 96 97 return false; 97 98 } … … 113 114 psFree(query); 114 115 116 if (!insert_dbversion(config, IPPDB_VERSION)) { 117 psError(PS_ERR_UNKNOWN, false, "failed to set database version"); 118 return false; 119 } 120 115 121 // COMMIT 116 122 if (!psDBCommit(config->dbh)) { … … 129 135 psString query = pxDataGet("pxadmin_create_mirror_tables.sql"); 130 136 if (!query) { 131 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");137 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 132 138 return false; 133 139 } … … 149 155 psFree(query); 150 156 157 if (!insert_dbversion(config, IPPDB_VERSION)) { 158 psError(PS_ERR_UNKNOWN, false, "failed to set database version"); 159 return false; 160 } 161 151 162 // COMMIT 152 163 if (!psDBCommit(config->dbh)) { … … 209 220 psString query = pxDataGet("pxadmin_drop_tables.sql"); 210 221 if (!query) { 211 psError(PXTOOLS_ERR_ DATA, false, "failed to retreive SQL statement");222 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 212 223 return false; 213 224 } … … 262 273 return true; 263 274 } 275 276 #ifdef notdef 277 static bool update_dbversion(pxConfig * config, const char *versionString) 278 { 279 psString query = pxDataGet("pxadmin_update_version.sql"); 280 if (!query) { 281 psError(PS_ERR_UNKNOWN, false, "failed to retrieve SQL statement"); 282 psFree(query); 283 return false; 284 } 285 if (!p_psDBRunQueryF(config->dbh, query, versionString)) { 286 psError(PS_ERR_UNKNOWN, false, "database error"); 287 psFree(query); 288 return false; 289 } 290 return true; 291 } 292 #endif 293 static bool insert_dbversion(pxConfig * config, const char *versionString) 294 { 295 psString query = "INSERT INTO dbversion VALUES('%s', CURRENT_TIMESTAMP())"; 296 if (!query) { 297 psError(PS_ERR_UNKNOWN, false, "failed to retrieve SQL statement"); 298 psFree(query); 299 return false; 300 } 301 if (!p_psDBRunQueryF(config->dbh, query, versionString)) { 302 psError(PS_ERR_UNKNOWN, false, "database error"); 303 psFree(query); 304 return false; 305 } 306 return true; 307 }
Note:
See TracChangeset
for help on using the changeset viewer.
