IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ticket #413: pslib-0.6-psdbrunquery_rename.patch

File pslib-0.6-psdbrunquery_rename.patch, 4.3 KB (added by jhoblitt, 21 years ago)

rename psDBRunQuery -> p_psDBRunQuery and make the symbol public

  • pslib/src/dataIO/psDB.

    ---------------------
    PatchSet 251 
    Date: 2005/05/16 21:57:14
    Author: jhoblitt
    Branch: HEAD
    Tag: (none) 
    Log:
    rename psDBRunQuery -> p_psDBRunQuery and make the symbol public
    
    Members: 
    	src/dataIO/psDB.c:1.1->1.2 
    	src/dataIO/psDB.h:1.1->1.2 
    
    diff -u pslib/src/dataIO/psDB.c:1.1 pslib/src/dataIO/psDB.c:1.2
    old new  
    1111 *  @author Aaron Culliney
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.1 $ $Name:  $
    15  *  @date $Date: 2005/05/06 18:15:25 $
     14 *  @version $Revision: 1.2 $ $Name:  $
     15 *  @date $Date: 2005/05/16 21:57:14 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
    1818 */
     
    4242mysqlType;
    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
    4847// SQL generation functions
     
    135134    psStringAppend(&query, "CREATE DATABASE %s", dbname);
    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.");
    141140    }
     
    164163    psStringAppend(&query, "DROP DATABASE %s", dbname);
    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.");
    170169    }
     
    186185        return NULL;
    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.");
    192191    }
     
    203202
    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.");
    209208    }
     
    230229        return NULL;
    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);
    236235        return NULL;
     
    387386        return NULL;
    388387    }
    389388
    390     if (!psDBRunQuery(dbh, query)) {
     389    if (!p_psDBRunQuery(dbh, query)) {
    391390        psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
    392391
    393392        psFree(query);
     
    723722        return -1;
    724723    }
    725724
    726     if (!psDBRunQuery(dbh, query)) {
     725    if (!p_psDBRunQuery(dbh, query)) {
    727726        psError(PS_ERR_UNKNOWN, false, "Delete failed.");
    728727
    729728        mysql_rollback(dbh->mysql);
     
    749748// database utility functions
    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) {
    755754        psError(PS_ERR_UNKNOWN, true, "Failed to execute query.  Error: %s\n", mysql_error(dbh->mysql));
  • pslib/src/dataIO/psDB.

    diff -u pslib/src/dataIO/psDB.h:1.1 pslib/src/dataIO/psDB.h:1.2
    old new  
    99 *
    1010 *  @author Joshua Hoblitt
    1111 *
    12  *  @version $Revision: 1.1 $ $Name:  $
    13  *  @date $Date: 2005/03/31 23:01:46 $
     12 *  @version $Revision: 1.2 $ $Name:  $
     13 *  @date $Date: 2005/05/16 21:57:14 $
    1414 *
    1515 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
    1616 */
     
    8282    const char *dbname                  ///< Database namespace
    8383);
    8484
     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
     96);
     97
    8598/** Creates a new database table
    8699 *
    87100 * This function generates and executes the SQL needed to create a table named