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:51 +0000 (21:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Dec 2003 21:45:51 +0000 (21:45 +0000)
src/backend/utils/adt/datetime.c

index 823c5cc775fdbeed65abb6c2137dc4af8626c4aa..3d54883b267ac2bd0a51243c57ef6a280a66f748 100644 (file)
@@ -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')