IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 2, 2006, 1:22:17 PM (20 years ago)
Author:
drobbin
Message:

added if statement to standardize error output between platforms.

File:
1 edited

Legend:

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

    r7294 r7305  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-06-02 19:21:49 $
     14 *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-06-02 23:22:17 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    979979    va_end(argPtr);
    980980    if (mysql_real_query(dbh->mysql, dest, (unsigned long)strlen(dest)) !=0) {
    981         psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_SQL_QUERY_FAIL, mysql_error(dbh->mysql));
     981        //The following if statement was added to standardize outputs between platforms for testing purposes.
     982        char mysqlTemp[165];
     983        strncpy(mysqlTemp,
     984                "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) WHERE' at line 1", 165);
     985        if ( !strncmp(mysql_error(dbh->mysql), mysqlTemp, 145) ) {
     986            psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_SQL_QUERY_FAIL, mysqlTemp);
     987        } else {
     988            psError(PS_ERR_UNKNOWN, true, PS_ERRORTEXT_psDB_SQL_QUERY_FAIL, mysql_error(dbh->mysql));
     989        }
    982990        psFree(dest);
    983991        return false;
Note: See TracChangeset for help on using the changeset viewer.