Skip to content

Commit 439cf8e

Browse files
author
Michael Meskes
committed
Do not try to find local timezone in DecodeDateTime() because the
result is not used anyway. This also fixes Vista's build problems.
1 parent a8d539f commit 439cf8e

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

src/interfaces/ecpg/ChangeLog

+3-3
Original file line numberDiff line numberDiff line change
@@ -2194,8 +2194,8 @@ Thu, 10 May 09:42:42 CEST 2007
21942194
- Synced parser and keyword list.
21952195
- Renamed update test so it hopefully runs on Vista.
21962196

2197-
Th, 17 May 2007 22:03:40 +0200
2197+
Sun, 20 May 2007 22:01:11 +0200
21982198

2199-
- Removed mktime() call to hopefully get rid of some compatibility
2200-
problems.
2199+
- Do not try to find local timezone in DecodeDateTime() because the
2200+
result is not used anyway. This also fixes Vista's build problems.
22012201
- Set ecpg version to 4.3.1.

src/interfaces/ecpg/pgtypeslib/dt_common.c

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.38 2007/05/20 11:30:30 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/pgtypeslib/dt_common.c,v 1.39 2007/05/21 07:04:00 meskes Exp $ */
22

33
#include "postgres_fe.h"
44

@@ -2528,20 +2528,12 @@ DecodeDateTime(char **field, int *ftype, int nf,
25282528
if (tm->tm_mday < 1 || tm->tm_mday > day_tab[isleap(tm->tm_year)][tm->tm_mon - 1])
25292529
return -1;
25302530

2531-
/* timezone not specified? then find local timezone if possible */
2532-
if ((fmask & DTK_DATE_M) == DTK_DATE_M && tzp != NULL && !(fmask & DTK_M(TZ)))
2533-
{
2534-
/*
2535-
* daylight savings time modifier but no standard timezone? then
2536-
* error
2537-
*/
2538-
if (fmask & DTK_M(DTZMOD))
2531+
/* backend tried to find local timezone here
2532+
* but we don't use the result afterwards anyway
2533+
* so we only check for this error:
2534+
* daylight savings time modifier but no standard timezone? */
2535+
if ((fmask & DTK_DATE_M) == DTK_DATE_M && tzp != NULL && !(fmask & DTK_M(TZ)) && (fmask & DTK_M(DTZMOD)))
25392536
return -1;
2540-
2541-
/* test to see if this is the reason for the error on Vista
2542-
* doesn't seem to be used anyway
2543-
* *tzp = DetermineLocalTimeZone(tm); */
2544-
}
25452537
}
25462538

25472539
return 0;

0 commit comments

Comments
 (0)