Skip to content

Commit 90ef9d9

Browse files
committed
Remove environment sensitivity in pl/tcl regression test.
Add "-gmt 1" to our test invocations of the Tcl "clock" command, so that they do not consult the timezone environment. While it doesn't really matter which timezone is used here, it does matter that the command not fall over entirely. We've now discovered that at least on FreeBSD, "clock scan" will fail if /etc/localtime is missing. It seems worth making the test insensitive to that. Per Tomas Vondras' buildfarm animal dikkop. Thanks to Thomas Munro for the diagnosis. Discussion: https://postgr.es/m/316d304a-1dcd-cea1-3d6c-27f794727a06@enterprisedb.com
1 parent 4d10fda commit 90ef9d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pl/tcl/expected/pltcl_setup.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ CREATE OPERATOR CLASS tcl_int4_ops
542542
-- for initialization problems.
543543
--
544544
create function tcl_date_week(int4,int4,int4) returns text as $$
545-
return [clock format [clock scan "$2/$3/$1"] -format "%U"]
545+
return [clock format [clock scan "$2/$3/$1" -gmt 1] -format "%U" -gmt 1]
546546
$$ language pltcl immutable;
547547
select tcl_date_week(2010,1,26);
548548
tcl_date_week

src/pl/tcl/sql/pltcl_setup.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ CREATE OPERATOR CLASS tcl_int4_ops
596596
-- for initialization problems.
597597
--
598598
create function tcl_date_week(int4,int4,int4) returns text as $$
599-
return [clock format [clock scan "$2/$3/$1"] -format "%U"]
599+
return [clock format [clock scan "$2/$3/$1" -gmt 1] -format "%U" -gmt 1]
600600
$$ language pltcl immutable;
601601

602602
select tcl_date_week(2010,1,26);

0 commit comments

Comments
 (0)