]> granicus.if.org Git - postgresql/commitdiff
Fix DecodeInterval to handle '-0.1' sanely, per gripe from Tilo Schwarz.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Dec 2003 21:45:44 +0000 (21:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Dec 2003 21:45:44 +0000 (21:45 +0000)
src/backend/utils/adt/datetime.c

index 1e357e5c6eb65eb88c8a90e93cbc46665b4cea9b..01317053b7f6b61216fede369f94ab1ba282f19e 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.120 2003/11/29 19:51:58 pgsql Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.121 2003/12/17 21:45:44 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -3005,7 +3005,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
                                        if (*cp != '\0')
                                                return DTERR_BAD_FORMAT;
 
-                                       if (val < 0)
+                                       if (*field[i] == '-')
                                                fval = -(fval);
                                }
                                else if (*cp == '\0')