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

Commit 4a071af

Browse files
committed
Stabilize timetz test across DST transitions.
The timetz test cases I added in commit a963283 were unintentionally sensitive to whether or not DST is active in the PST8PDT time zone. Thus, they'll start failing this coming weekend, as reported by Bernhard M. Wiedemann in bug #16689. Fortunately, DST-awareness is not significant to the purpose of these test cases, so we can just force them all to PDT (DST hours) to preserve stability of the results. Back-patch to v10, as the prior patch was. Discussion: https://postgr.es/m/16689-57701daa23b377bf@postgresql.org
1 parent f90149e commit 4a071af

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/test/regress/expected/timetz.out

+16-16
Original file line numberDiff line numberDiff line change
@@ -91,45 +91,45 @@ SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
9191
(12 rows)
9292

9393
-- Check edge cases
94-
SELECT '23:59:59.999999'::timetz;
94+
SELECT '23:59:59.999999 PDT'::timetz;
9595
timetz
9696
--------------------
9797
23:59:59.999999-07
9898
(1 row)
9999

100-
SELECT '23:59:59.9999999'::timetz; -- rounds up
100+
SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
101101
timetz
102102
-------------
103103
24:00:00-07
104104
(1 row)
105105

106-
SELECT '23:59:60'::timetz; -- rounds up
106+
SELECT '23:59:60 PDT'::timetz; -- rounds up
107107
timetz
108108
-------------
109109
24:00:00-07
110110
(1 row)
111111

112-
SELECT '24:00:00'::timetz; -- allowed
112+
SELECT '24:00:00 PDT'::timetz; -- allowed
113113
timetz
114114
-------------
115115
24:00:00-07
116116
(1 row)
117117

118-
SELECT '24:00:00.01'::timetz; -- not allowed
119-
ERROR: date/time field value out of range: "24:00:00.01"
120-
LINE 1: SELECT '24:00:00.01'::timetz;
118+
SELECT '24:00:00.01 PDT'::timetz; -- not allowed
119+
ERROR: date/time field value out of range: "24:00:00.01 PDT"
120+
LINE 1: SELECT '24:00:00.01 PDT'::timetz;
121121
^
122-
SELECT '23:59:60.01'::timetz; -- not allowed
123-
ERROR: date/time field value out of range: "23:59:60.01"
124-
LINE 1: SELECT '23:59:60.01'::timetz;
122+
SELECT '23:59:60.01 PDT'::timetz; -- not allowed
123+
ERROR: date/time field value out of range: "23:59:60.01 PDT"
124+
LINE 1: SELECT '23:59:60.01 PDT'::timetz;
125125
^
126-
SELECT '24:01:00'::timetz; -- not allowed
127-
ERROR: date/time field value out of range: "24:01:00"
128-
LINE 1: SELECT '24:01:00'::timetz;
126+
SELECT '24:01:00 PDT'::timetz; -- not allowed
127+
ERROR: date/time field value out of range: "24:01:00 PDT"
128+
LINE 1: SELECT '24:01:00 PDT'::timetz;
129129
^
130-
SELECT '25:00:00'::timetz; -- not allowed
131-
ERROR: date/time field value out of range: "25:00:00"
132-
LINE 1: SELECT '25:00:00'::timetz;
130+
SELECT '25:00:00 PDT'::timetz; -- not allowed
131+
ERROR: date/time field value out of range: "25:00:00 PDT"
132+
LINE 1: SELECT '25:00:00 PDT'::timetz;
133133
^
134134
--
135135
-- TIME simple math

src/test/regress/sql/timetz.sql

+8-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ SELECT f1 AS "None" FROM TIMETZ_TBL WHERE f1 < '00:00-07';
3636
SELECT f1 AS "Ten" FROM TIMETZ_TBL WHERE f1 >= '00:00-07';
3737

3838
-- Check edge cases
39-
SELECT '23:59:59.999999'::timetz;
40-
SELECT '23:59:59.9999999'::timetz; -- rounds up
41-
SELECT '23:59:60'::timetz; -- rounds up
42-
SELECT '24:00:00'::timetz; -- allowed
43-
SELECT '24:00:00.01'::timetz; -- not allowed
44-
SELECT '23:59:60.01'::timetz; -- not allowed
45-
SELECT '24:01:00'::timetz; -- not allowed
46-
SELECT '25:00:00'::timetz; -- not allowed
39+
SELECT '23:59:59.999999 PDT'::timetz;
40+
SELECT '23:59:59.9999999 PDT'::timetz; -- rounds up
41+
SELECT '23:59:60 PDT'::timetz; -- rounds up
42+
SELECT '24:00:00 PDT'::timetz; -- allowed
43+
SELECT '24:00:00.01 PDT'::timetz; -- not allowed
44+
SELECT '23:59:60.01 PDT'::timetz; -- not allowed
45+
SELECT '24:01:00 PDT'::timetz; -- not allowed
46+
SELECT '25:00:00 PDT'::timetz; -- not allowed
4747

4848
--
4949
-- TIME simple math

0 commit comments

Comments
 (0)