IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3957 for trunk/psLib/src/db


Ignore:
Timestamp:
May 17, 2005, 2:55:36 PM (21 years ago)
Author:
asc
Message:

Applied Josh's patch (bugzilla #413)

Location:
trunk/psLib/src/db
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r3866 r3957  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.16 $ $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 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    4343
    4444// database utility functions
    45 static bool     psDBRunQuery(psDB *dbh, const char *query);
    4645static inline bool psDBPackRow(MYSQL_BIND *bind, psMetadata *values, psU32 paramCount);
    4746
     
    136135
    137136    // the MySQL C API notes that mysql_create_db() is deprecated
    138     status = psDBRunQuery(dbh, query);
     137    status = p_psDBRunQuery(dbh, query);
    139138    if (!status) {
    140139        psError(PS_ERR_UNKNOWN, false, "Failed to create new database.");
     
    165164
    166165    // the MySQL C API notes that mysql_drop_db() is deprecated
    167     status = psDBRunQuery(dbh, query);
     166    status = p_psDBRunQuery(dbh, query);
    168167    if (!status) {
    169168        psError(PS_ERR_UNKNOWN, false, "Failed to drop database.");
     
    187186    }
    188187
    189     status = psDBRunQuery(dbh, query);
     188    status = p_psDBRunQuery(dbh, query);
    190189    if (!status) {
    191190        psError(PS_ERR_UNKNOWN, false, "Failed to create table.");
     
    204203    psStringAppend(&query, "DROP TABLE %s", tableName);
    205204
    206     status = psDBRunQuery(dbh, query);
     205    status = p_psDBRunQuery(dbh, query);
    207206    if (!status) {
    208207        psError(PS_ERR_UNKNOWN, false, "Failed to drop table.");
     
    231230    }
    232231
    233     if (!psDBRunQuery(dbh, query)) {
     232    if (!p_psDBRunQuery(dbh, query)) {
    234233        psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
    235234        psFree(query);
     
    388387    }
    389388
    390     if (!psDBRunQuery(dbh, query)) {
     389    if (!p_psDBRunQuery(dbh, query)) {
    391390        psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
    392391
     
    724723    }
    725724
    726     if (!psDBRunQuery(dbh, query)) {
     725    if (!p_psDBRunQuery(dbh, query)) {
    727726        psError(PS_ERR_UNKNOWN, false, "Delete failed.");
    728727
     
    750749/*****************************************************************************/
    751750
    752 static bool psDBRunQuery(psDB *dbh, const char *query)
     751bool p_psDBRunQuery(psDB *dbh, const char *query)
    753752{
    754753    if (mysql_real_query(dbh->mysql, query, (unsigned long)strlen(query)) !=0) {
  • trunk/psLib/src/db/psDB.h

    r3598 r3957  
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-31 23:01:46 $
     12 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-05-18 00:55:36 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    8181    psDB *dbh,                          ///< Database handle
    8282    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 */
     93bool p_psDBRunQuery(
     94    psDB *dbh,                          ///< Database handle
     95    const char *query                   ///< SQL string to execute
    8396);
    8497
Note: See TracChangeset for help on using the changeset viewer.