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

Commit f021546

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 0cfc231 commit f021546

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pl/tcl/expected/pltcl_setup.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ CREATE OPERATOR CLASS tcl_int4_ops
119119
-- for initialization problems.
120120
--
121121
create function tcl_date_week(int4,int4,int4) returns text as $$
122-
return [clock format [clock scan "$2/$3/$1"] -format "%U"]
122+
return [clock format [clock scan "$2/$3/$1" -gmt 1] -format "%U" -gmt 1]
123123
$$ language pltcl immutable;
124124
select tcl_date_week(2010,1,26);
125125
tcl_date_week

src/pl/tcl/sql/pltcl_setup.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ CREATE OPERATOR CLASS tcl_int4_ops
142142
-- for initialization problems.
143143
--
144144
create function tcl_date_week(int4,int4,int4) returns text as $$
145-
return [clock format [clock scan "$2/$3/$1"] -format "%U"]
145+
return [clock format [clock scan "$2/$3/$1" -gmt 1] -format "%U" -gmt 1]
146146
$$ language pltcl immutable;
147147

148148
select tcl_date_week(2010,1,26);

0 commit comments

Comments
 (0)