diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/ecpg/pgtypeslib/dt_common.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c index 305f192a7bd..b5939c243ec 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt_common.c +++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c @@ -2095,7 +2095,9 @@ DecodeDateTime(char **field, int *ftype, int nf, * Check upper limit on hours; other limits checked in * DecodeTime() */ - if (tm->tm_hour > 23) + /* test for > 24:00:00 */ + if (tm->tm_hour > 24 || + (tm->tm_hour == 24 && (tm->tm_min > 0 || tm->tm_sec > 0))) return -1; break; @@ -3161,7 +3163,8 @@ PGTYPEStimestamp_defmt_scan(char **str, char *fmt, timestamp *d, err = 1; *minute = 0; } - if (*hour > 23) + if (*hour > 24 || /* test for > 24:00:00 */ + (*hour == 24 && (*minute > 0 || *second > 0))) { err = 1; *hour = 0; |