Changeset 3957 for trunk/psLib/src/db
- Timestamp:
- May 17, 2005, 2:55:36 PM (21 years ago)
- Location:
- trunk/psLib/src/db
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r3866 r3957 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-05- 06 18:15:25$14 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-05-18 00:55:36 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 43 43 44 44 // database utility functions 45 static bool psDBRunQuery(psDB *dbh, const char *query);46 45 static inline bool psDBPackRow(MYSQL_BIND *bind, psMetadata *values, psU32 paramCount); 47 46 … … 136 135 137 136 // the MySQL C API notes that mysql_create_db() is deprecated 138 status = p sDBRunQuery(dbh, query);137 status = p_psDBRunQuery(dbh, query); 139 138 if (!status) { 140 139 psError(PS_ERR_UNKNOWN, false, "Failed to create new database."); … … 165 164 166 165 // the MySQL C API notes that mysql_drop_db() is deprecated 167 status = p sDBRunQuery(dbh, query);166 status = p_psDBRunQuery(dbh, query); 168 167 if (!status) { 169 168 psError(PS_ERR_UNKNOWN, false, "Failed to drop database."); … … 187 186 } 188 187 189 status = p sDBRunQuery(dbh, query);188 status = p_psDBRunQuery(dbh, query); 190 189 if (!status) { 191 190 psError(PS_ERR_UNKNOWN, false, "Failed to create table."); … … 204 203 psStringAppend(&query, "DROP TABLE %s", tableName); 205 204 206 status = p sDBRunQuery(dbh, query);205 status = p_psDBRunQuery(dbh, query); 207 206 if (!status) { 208 207 psError(PS_ERR_UNKNOWN, false, "Failed to drop table."); … … 231 230 } 232 231 233 if (!p sDBRunQuery(dbh, query)) {232 if (!p_psDBRunQuery(dbh, query)) { 234 233 psError(PS_ERR_UNKNOWN, false, "Query execution failed."); 235 234 psFree(query); … … 388 387 } 389 388 390 if (!p sDBRunQuery(dbh, query)) {389 if (!p_psDBRunQuery(dbh, query)) { 391 390 psError(PS_ERR_UNKNOWN, false, "Query execution failed."); 392 391 … … 724 723 } 725 724 726 if (!p sDBRunQuery(dbh, query)) {725 if (!p_psDBRunQuery(dbh, query)) { 727 726 psError(PS_ERR_UNKNOWN, false, "Delete failed."); 728 727 … … 750 749 /*****************************************************************************/ 751 750 752 static boolpsDBRunQuery(psDB *dbh, const char *query)751 bool p_psDBRunQuery(psDB *dbh, const char *query) 753 752 { 754 753 if (mysql_real_query(dbh->mysql, query, (unsigned long)strlen(query)) !=0) { -
trunk/psLib/src/db/psDB.h
r3598 r3957 10 10 * @author Joshua Hoblitt 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 3-31 23:01:46 $12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-05-18 00:55:36 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 81 81 psDB *dbh, ///< Database handle 82 82 const char *dbname ///< Database namespace 83 ); 84 85 /** Executes a SQL query 86 * 87 * This function will execute a string as a raw SQL query. No additional 88 * processing of the string or abstraction of the underlying database's SQL 89 * dialect is provided. Caveat emptor. 90 * 91 * @return true on success 92 */ 93 bool p_psDBRunQuery( 94 psDB *dbh, ///< Database handle 95 const char *query ///< SQL string to execute 83 96 ); 84 97
Note:
See TracChangeset
for help on using the changeset viewer.
