mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-11 19:20:40 +08:00
Code for SET/SHOW TIME ZONE with a fixed-interval timezone was not
prepared for HAVE_INT64_TIMESTAMP. Per report from Guillaume Beaudoin.
This commit is contained in:
parent
272f23c814
commit
2f5b2558d3
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.105 2004/12/31 21:59:42 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.105.4.1 2005/06/05 01:48:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -284,7 +284,11 @@ assign_timezone(const char *value, bool doit, GucSource source)
|
||||
if (doit)
|
||||
{
|
||||
/* Here we change from SQL to Unix sign convention */
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
CTimeZone = -(interval->time / INT64CONST(1000000));
|
||||
#else
|
||||
CTimeZone = -interval->time;
|
||||
#endif
|
||||
|
||||
HasCTZSet = true;
|
||||
}
|
||||
@ -452,8 +456,12 @@ show_timezone(void)
|
||||
{
|
||||
Interval interval;
|
||||
|
||||
interval. month = 0;
|
||||
interval. time = -CTimeZone;
|
||||
interval.month = 0;
|
||||
#ifdef HAVE_INT64_TIMESTAMP
|
||||
interval.time = -(CTimeZone * INT64CONST(1000000));
|
||||
#else
|
||||
interval.time = -CTimeZone;
|
||||
#endif
|
||||
|
||||
tzn = DatumGetCString(DirectFunctionCall1(interval_out,
|
||||
IntervalPGetDatum(&interval)));
|
||||
|
Loading…
Reference in New Issue
Block a user