Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 63bd0db

Browse files
committed
Integrate src/timezone library for all platforms. There is more we can
and should do now that we control our own destiny for timezone handling, but this commit gets the bulk of the picayune diffs in place. Magnus Hagander and Tom Lane.
1 parent 260b513 commit 63bd0db

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1342
-8101
lines changed

configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -12014,7 +12014,7 @@ LIBOBJS="$LIBOBJS open.$ac_objext"
1201412014
LIBOBJS="$LIBOBJS rand.$ac_objext" ;;
1201512015
esac
1201612016

12017-
# Win32 can't to rename or unlink on an open file
12017+
# Win32 can't do rename or unlink on an open file
1201812018
case $host_os in mingw*|cygwin*)
1201912019
LIBOBJS="$LIBOBJS dirmod.$ac_objext" ;;
1202012020
esac

configure.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.355 2004/05/20 23:49:41 pgsql Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.356 2004/05/21 05:07:54 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
66
dnl 0. Initialization and options processing
77
dnl 1. Programs
88
dnl 2. Libraries
9-
dnl 3. Header files
9+
dnl 3. Header files
1010
dnl 4. Types
1111
dnl 5. Structures
1212
dnl 6. Compiler characteristics
@@ -895,7 +895,7 @@ AC_LIBOBJ(open)
895895
AC_LIBOBJ(rand) ;;
896896
esac
897897

898-
# Win32 can't to rename or unlink on an open file
898+
# Win32 can't do rename or unlink on an open file
899899
case $host_os in mingw*|cygwin*)
900900
AC_LIBOBJ(dirmod) ;;
901901
esac

doc/src/sgml/regress.sgml

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.39 2004/03/15 16:11:42 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.40 2004/05/21 05:07:55 tgl Exp $ -->
22

33
<chapter id="regress">
44
<title id="regress-title">Regression Tests</title>
@@ -378,20 +378,19 @@ testname/platformpattern=comparisonfilename
378378
</para>
379379

380380
<para>
381-
For example: some systems using older time zone libraries fail to apply
382-
daylight-saving corrections to dates before 1970, causing
383-
pre-1970 <acronym>PDT</acronym> times to be displayed in <acronym>PST</acronym> instead. This causes a
384-
few differences in the <filename>horology</> regression test.
381+
For example: some systems interpret very small floating-point values
382+
as zero, rather than reporting an underflow error. This causes a
383+
few differences in the <filename>float8</> regression test.
385384
Therefore, we provide a variant comparison file,
386-
<filename>horology-no-DST-before-1970.out</filename>, which includes
385+
<filename>float8-small-is-zero.out</filename>, which includes
387386
the results to be expected on these systems. To silence the bogus
388-
<quote>failure</quote> message on <systemitem>HPUX</systemitem> platforms,
389-
<filename>resultmap</filename> includes
387+
<quote>failure</quote> message on <systemitem>OpenBSD</systemitem>
388+
platforms, <filename>resultmap</filename> includes
390389
<programlisting>
391-
horology/.*-hpux=horology-no-DST-before-1970
390+
float8/i.86-.*-openbsd=float8-small-is-zero
392391
</programlisting>
393392
which will trigger on any machine for which the output of
394-
<command>config.guess</command> includes <literal>-hpux</literal>.
393+
<command>config.guess</command> matches <literal>i.86-.*-openbsd</literal>.
395394
Other lines
396395
in <filename>resultmap</> select the variant comparison file for other
397396
platforms where it's appropriate.

src/Makefile.global.in

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.184 2004/05/14 00:03:07 momjian Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.185 2004/05/21 05:07:55 tgl Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -147,8 +147,6 @@ TK_LIBS = @TK_LIBS@
147147
TK_LIB_SPEC = @TK_LIB_SPEC@
148148
TK_XINCLUDES = @TK_XINCLUDES@
149149

150-
USE_PGTZ = @USE_PGTZ@
151-
152150
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
153151
PTHREAD_LIBS = @PTHREAD_LIBS@
154152

src/backend/Makefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.99 2004/04/30 16:08:01 momjian Exp $
7+
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.100 2004/05/21 05:07:55 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -14,11 +14,7 @@ include $(top_builddir)/src/Makefile.global
1414

1515
DIRS := access bootstrap catalog parser commands executor lib libpq \
1616
main nodes optimizer port postmaster regex rewrite \
17-
storage tcop utils
18-
19-
ifeq ($(USE_PGTZ), yes)
20-
DIRS+= $(top_builddir)/src/timezone
21-
endif
17+
storage tcop utils $(top_builddir)/src/timezone
2218

2319
OBJS := $(DIRS:%=%/SUBSYS.o)
2420

src/backend/access/transam/xact.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.165 2004/04/05 03:11:39 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.166 2004/05/21 05:07:56 tgl Exp $
1212
*
1313
* NOTES
1414
* Transaction aborts can now occur two ways:
@@ -1828,7 +1828,7 @@ xact_desc(char *buf, uint8 xl_info, char *rec)
18281828
if (info == XLOG_XACT_COMMIT)
18291829
{
18301830
xl_xact_commit *xlrec = (xl_xact_commit *) rec;
1831-
struct tm *tm = localtime(&xlrec->xtime);
1831+
struct pg_tm *tm = pg_localtime(&xlrec->xtime);
18321832

18331833
sprintf(buf + strlen(buf), "commit: %04u-%02u-%02u %02u:%02u:%02u",
18341834
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
@@ -1838,7 +1838,7 @@ xact_desc(char *buf, uint8 xl_info, char *rec)
18381838
else if (info == XLOG_XACT_ABORT)
18391839
{
18401840
xl_xact_abort *xlrec = (xl_xact_abort *) rec;
1841-
struct tm *tm = localtime(&xlrec->xtime);
1841+
struct pg_tm *tm = pg_localtime(&xlrec->xtime);
18421842

18431843
sprintf(buf + strlen(buf), "abort: %04u-%02u-%02u %02u:%02u:%02u",
18441844
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,

src/backend/access/transam/xlog.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.140 2004/05/07 00:24:57 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.141 2004/05/21 05:07:56 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -18,7 +18,6 @@
1818
#include <signal.h>
1919
#include <unistd.h>
2020
#include <sys/stat.h>
21-
#include <sys/time.h>
2221

2322
#include "access/clog.h"
2423
#include "access/transam.h"
@@ -2764,9 +2763,9 @@ str_time(time_t tnow)
27642763
{
27652764
static char buf[128];
27662765

2767-
strftime(buf, sizeof(buf),
2766+
pg_strftime(buf, sizeof(buf),
27682767
"%Y-%m-%d %H:%M:%S %Z",
2769-
localtime(&tnow));
2768+
pg_localtime(&tnow));
27702769

27712770
return buf;
27722771
}

src/backend/bootstrap/bootparse.y

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.66 2004/05/05 04:48:45 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.67 2004/05/21 05:07:56 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616

1717
#include "postgres.h"
1818

19-
#include <time.h>
2019
#include <unistd.h>
2120

2221
#include "access/attnum.h"
@@ -39,6 +38,7 @@
3938
#include "nodes/parsenodes.h"
4039
#include "nodes/pg_list.h"
4140
#include "nodes/primnodes.h"
41+
#include "pgtime.h"
4242
#include "rewrite/prs2lock.h"
4343
#include "storage/block.h"
4444
#include "storage/fd.h"

src/backend/bootstrap/bootscanner.l

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootscanner.l,v 1.33 2004/02/24 22:06:32 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootscanner.l,v 1.34 2004/05/21 05:07:56 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616
#include "postgres.h"
1717

18-
#include <time.h>
19-
2018
#include "access/attnum.h"
2119
#include "access/htup.h"
2220
#include "access/itup.h"
@@ -31,6 +29,7 @@
3129
#include "nodes/pg_list.h"
3230
#include "nodes/primnodes.h"
3331
#include "parser/scansup.h"
32+
#include "pgtime.h"
3433
#include "rewrite/prs2lock.h"
3534
#include "storage/block.h"
3635
#include "storage/fd.h"

src/backend/bootstrap/bootstrap.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.178 2004/04/01 21:28:43 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.179 2004/05/21 05:07:56 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515
#include "postgres.h"
1616

1717
#include <unistd.h>
18-
#include <time.h>
1918
#include <signal.h>
2019
#include <setjmp.h>
2120
#ifdef HAVE_GETOPT_H
@@ -34,6 +33,7 @@
3433
#include "executor/executor.h"
3534
#include "libpq/pqsignal.h"
3635
#include "miscadmin.h"
36+
#include "pgtime.h"
3737
#include "storage/freespace.h"
3838
#include "storage/ipc.h"
3939
#include "storage/pg_shmem.h"
@@ -392,15 +392,18 @@ BootstrapMain(int argc, char *argv[])
392392
if (IsUnderPostmaster)
393393
{
394394
#ifdef EXEC_BACKEND
395-
read_nondefault_variables();
396395
read_backend_variables(backendID,NULL);
396+
read_nondefault_variables();
397397

398398
SSDataBaseInit(xlogop);
399399
#endif
400400
}
401401
else
402402
ProcessConfigFile(PGC_POSTMASTER);
403403

404+
/* If timezone is not set, determine what the OS uses */
405+
pg_timezone_initialize();
406+
404407
if (IsUnderPostmaster)
405408
{
406409
/*

0 commit comments

Comments
 (0)