diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-02-20 05:25:25 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-02-20 05:25:25 +0000 |
commit | 2bba78d605d8f71f5e60c63ea66afa43d4e24280 (patch) | |
tree | 4e5fc4de2ec09278827cd4b36f7ba85218e14571 /src/backend/utils/adt/nabstime.c | |
parent | d1bb0db8dd208236f84f54e3c4ef6eac2ae4e71e (diff) |
Fix timestamptz_in so that parsing of 'now'::timestamptz gives right
answer when SET TIMEZONE has been done since the start of the current
transaction. Per bug report from Robert Haas.
I plan some futher cleanup in HEAD, but this is a low-risk patch for
the immediate issue in 7.3.
Diffstat (limited to 'src/backend/utils/adt/nabstime.c')
-rw-r--r-- | src/backend/utils/adt/nabstime.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index c773ccbdab7..6de79aaa9cd 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.100.2.2 2002/12/12 19:17:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.100.2.3 2003/02/20 05:25:24 tgl Exp $ * * NOTES * @@ -243,25 +243,24 @@ GetCurrentDateTime(struct tm * tm) int tz; abstime2tm(GetCurrentTransactionStartTime(), &tz, tm, NULL); - - return; } /* GetCurrentDateTime() */ void -GetCurrentTimeUsec(struct tm * tm, fsec_t *fsec) +GetCurrentTimeUsec(struct tm * tm, fsec_t *fsec, int *tzp) { int tz; int usec; abstime2tm(GetCurrentTransactionStartTimeUsec(&usec), &tz, tm, NULL); + /* Note: don't pass NULL tzp directly to abstime2tm */ + if (tzp != NULL) + *tzp = tz; #ifdef HAVE_INT64_TIMESTAMP *fsec = usec; #else *fsec = usec * 1.0e-6; #endif - - return; } /* GetCurrentTimeUsec() */ |