IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2005, 11:49:16 AM (21 years ago)
Author:
jhoblitt
Message:

fix logic error in psDBPackRow()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/psdb/psDB.c

    r3210 r3217  
    88 *  @author Joshua Hoblitt
    99 *
    10  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-02-13 23:18:26 $
     10 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-02-14 21:49:16 $
    1212 *
    1313 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    516516
    517517    if (mysql_stmt_prepare(stmt, query, (unsigned long)strlen(query))) {
    518             fprintf(stderr, "Failed to prepare query.  Error: %s\n", mysql_stmt_error(stmt));
    519 
    520             mysql_stmt_close(stmt);
    521             psFree(query);
    522 
    523             return false;
     518        fprintf(stderr, "Failed to prepare query.  Error: %s\n", mysql_stmt_error(stmt));
     519
     520        mysql_stmt_close(stmt);
     521        psFree(query);
     522
     523        return false;
    524524    }
    525525
     
    759759        bind[i].is_unsigned = mType->isUnsigned;
    760760
    761         // convert NaNs to NULL
    762         bind[i].is_null = psDBIsPTypeNaN(item->pType, item->data.V)
    763                         ? (my_bool *)&isNull
    764                         : NULL;
    765 
     761        // convert NaNs to NULL and set the buffer_length for strings
    766762        if (item->pType == PS_TYPE_PTR) {
    767763            if (item->type == PS_META_STR) {
     
    779775                return false;
    780776            }
     777        } else {
     778            // for all primitive types
     779            bind[i].is_null = psDBIsPTypeNaN(item->pType, item->data.V)
     780                            ? (my_bool *)&isNull
     781                            : NULL;
    781782        }
    782783
Note: See TracChangeset for help on using the changeset viewer.