IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9681


Ignore:
Timestamp:
Oct 20, 2006, 2:33:00 PM (20 years ago)
Author:
jhoblitt
Message:

fix NULL time value pass throught in p_psDBFetchResult()

File:
1 edited

Legend:

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

    r9680 r9681  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.104 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-10-21 00:10:41 $
     14 *  @version $Revision: 1.105 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-10-21 00:33:00 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    10091009                psMetadataAdd(md, PS_LIST_TAIL, field[i].name, pType, "", atoi(data));
    10101010            } else if (pType == PS_DATA_TIME) {
    1011                 psTime *time = psTimeStrptime((char *)data, "%EY-%m-%d%t%T");
    1012                 if (!time) {
    1013                     psError(PS_ERR_UNKNOWN, true, "error parsing MySQL DateTime string");
    1014                     psFree(md);
    1015                     mysql_free_result(result);
    1016                     psFree(resultSet);
    1017                     return NULL;
     1011                // just pass NULL values through as there is currently no
     1012                // concept of a psTime with a NULL value
     1013                if (!(char *)data) {
     1014                    psMetadataAddTime(md, PS_LIST_TAIL, field[i].name, 0, "", NULL);
     1015                } else {
     1016                    psTime *time = psTimeStrptime((char *)data, "%EY-%m-%d%t%T");
     1017                    if (!time) {
     1018                        psError(PS_ERR_UNKNOWN, true, "error parsing MySQL DateTime string");
     1019                        psFree(md);
     1020                        mysql_free_result(result);
     1021                        psFree(resultSet);
     1022                        return NULL;
     1023                    }
     1024                    psMetadataAddTime(md, PS_LIST_TAIL, field[i].name, 0, "", time);
     1025                    psFree(time);
    10181026                }
    1019                 psMetadataAddTime(md, PS_LIST_TAIL, field[i].name, 0, "", time);
    1020                 psFree(time);
    10211027                #if 0
    10221028                // this is the procedure needed for stmt
Note: See TracChangeset for help on using the changeset viewer.