IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17904 for trunk/psLib


Ignore:
Timestamp:
Jun 4, 2008, 2:25:49 PM (18 years ago)
Author:
jhoblitt
Message:

add support for parseing "0000-00-00..." datetime/timestamp fields

File:
1 edited

Legend:

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

    r17871 r17904  
    2323 * 4.1.2 or newer is required.
    2424 *
    25  * $Id: psDB.c,v 1.160 2008-05-31 02:16:52 jhoblitt Exp $
     25 * $Id: psDB.c,v 1.161 2008-06-05 00:25:49 jhoblitt Exp $
    2626 */
    2727
     
    11981198                        return NULL;
    11991199                    }
     1200                } else if (psStrcasestr(data, "0000-00-00 00:00:00") == 0) {
     1201                    // look for 0000-00-00 00:00:00, which can't be parsed by
     1202                    // psTimeStrptime as the month/day are bogus
     1203                    if (!psMetadataAddTime(md, PS_LIST_TAIL, field[i].name, 0, "", NULL)) {
     1204                        psError(PS_ERR_UNKNOWN, false, "Failed to add item %s", field[i].name);
     1205                        psFree(data);
     1206                        psFree(md);
     1207                        mysql_free_result(result);
     1208                        psFree(resultSet);
     1209                        return NULL;
     1210                    }
     1211                    psFree(time);
     1212
    12001213                } else {
    12011214                    psTime *time = psTimeStrptime((char *)data, "%EY-%m-%d%t%T");
Note: See TracChangeset for help on using the changeset viewer.