Skip to content

Commit 78f637c

Browse files
committed
Fix DecodeInterval to handle '-0.1' sanely, per gripe from Tilo Schwarz.
1 parent a7e383d commit 78f637c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/datetime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.120 2003/11/29 19:51:58 pgsql Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.121 2003/12/17 21:45:44 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3005,7 +3005,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct tm * tm, fse
30053005
if (*cp != '\0')
30063006
return DTERR_BAD_FORMAT;
30073007

3008-
if (val < 0)
3008+
if (*field[i] == '-')
30093009
fval = -(fval);
30103010
}
30113011
else if (*cp == '\0')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy