Changeset 25851 for trunk/ippTools/src/pxadmin.c
- Timestamp:
- Oct 15, 2009, 11:37:32 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pxadmin.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pxadmin.c
r23310 r25851 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 … … 113 114 psFree(query); 114 115 116 if (!insert_dbversion(config, PACKAGE_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)) { … … 148 154 } 149 155 psFree(query); 156 157 if (!insert_dbversion(config, PACKAGE_VERSION)) { 158 psError(PS_ERR_UNKNOWN, false, "failed to set database version"); 159 return false; 160 } 150 161 151 162 // COMMIT … … 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.
