Changeset 8610 for trunk/psLib/src/db
- Timestamp:
- Aug 25, 2006, 2:32:39 PM (20 years ago)
- Location:
- trunk/psLib/src/db
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/db/psDB.c
r8602 r8610 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.8 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-08-2 5 22:02:40$14 * @version $Revision: 1.87 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-08-26 00:32:39 $ 16 16 * 17 17 * Copyright (C) 2005-2006 Joshua Hoblitt, University of Hawaii … … 1252 1252 } else if (item->type == PS_DATA_STRING) { 1253 1253 // + column name + _ + varchar( + length + ) 1254 psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V);1254 psStringAppend(&query, "%s VARCHAR(%s)", item->name, (char *)item->data.V); 1255 1255 } else { 1256 1256 psError(PS_ERR_BAD_PARAMETER_TYPE, true, … … 1289 1289 for (int i = 0; i < psArrayLength(pKeys); i++) { 1290 1290 if (i < 1) { 1291 psStringAppend(&query, "%s", pKeys->data[i]);1291 psStringAppend(&query, "%s", (char *)pKeys->data[i]); 1292 1292 } else { 1293 psStringAppend(&query, ", %s", pKeys->data[i]);1293 psStringAppend(&query, ", %s", (char *)pKeys->data[i]); 1294 1294 } 1295 1295 } … … 1642 1642 // very large TEXT columns that really shouldn't be 1643 1643 // used in a where clause... 1644 psStringAppend(&query, "%s LIKE '%s'", item->name, item->data.V);1644 psStringAppend(&query, "%s LIKE '%s'", item->name, (char *)item->data.V); 1645 1645 } else { 1646 psStringAppend(&query, "%s = '%s'", item->name, item->data.V);1646 psStringAppend(&query, "%s = '%s'", item->name, (char *)item->data.V); 1647 1647 } 1648 1648 } -
trunk/psLib/src/db/psDB.h
r8336 r8610 10 10 * @author Joshua Hoblitt 11 11 * 12 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2006-08- 15 02:28:13$12 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-08-26 00:32:39 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 90 90 * @return bool: true on success 91 91 */ 92 #ifdef __GNUC__ 92 93 bool p_psDBRunQuery( 93 94 psDB *dbh, ///< Database handle 94 95 const char *format, ///< SQL string to execute 95 96 ... ///< Arguments for name formatting and metadata item data. 96 ); 97 ) __attribute__((format(printf, 2, 3))); 98 99 #else // __GNUC__ 100 bool p_psDBRunQuery( 101 psDB *dbh, ///< Database handle 102 const char *format, ///< SQL string to execute 103 ... ///< Arguments for name formatting and metadata item data. 104 ); 105 #endif // __GNUC__ 97 106 98 107 /** Executes a SQL query as a prepared statement … … 104 113 * @return long: the number of database rows affected 105 114 */ 115 #ifdef __GNUC__ 106 116 long p_psDBRunQueryPrepared( 107 117 psDB *dbh, ///< Database handle … … 109 119 const char *format, ///< SQL string to execute 110 120 ... 111 ); 121 ) __attribute__((format(printf, 3, 4))); 122 #else // __GNUC__ 123 long p_psDBRunQueryPrepared( 124 psDB *dbh, ///< Database handle 125 const psArray *rowSet, ///< row data as psArray of psMetadata 126 const char *format, ///< SQL string to execute 127 ... 128 ); 129 #endif // __GNUC__ 112 130 113 131 /** Fetches the result of a SQL query
Note:
See TracChangeset
for help on using the changeset viewer.
