Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20f8671

Browse files
committed
Remove gratuitous environment dependency in 002_types.pl test.
Computing related timestamps by subtracting "N days" is sensitiveto the prevailing timezone, since we interpret that as "same localtime on the N'th prior day". Even though the intervals in questionare only two to four days, through remarkable bad luck they managedto cross the end of Ramadan in 2014, causing the test's output tochange if timezone is set to Africa/Casablanca. (Maybe in otherMuslim areas as well; I didn't check.) There's absolutely no reasonfor this test to exercise interval subtraction, so just get rid ofthat and use plain timestamptz constants representing the intendedvalues.Per report from Andres Freund. Back-patch to v10 where this testscript came in.Discussion:https://postgr.es/m/20210930183641.7lh4jhvpipvromca@alap3.anarazel.de
1 parentb484ddf commit20f8671

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/test/subscription/t/002_types.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@
237237
-- test_tbl_range_array
238238
INSERT INTO tst_range_array (a, b, c) VALUES
239239
(1, tstzrange('Mon Aug 04 00:00:00 2014 CEST'::timestamptz, 'infinity'), '{"[1,2]", "[10,20]"}'),
240-
(2, tstzrange('Mon Aug04 00:00:00 2014 CEST'::timestamptz - interval '2 days', 'Mon Aug 04 00:00:00 2014 CEST'::timestamptz), '{"[2,3]", "[20,30]"}'),
241-
(3, tstzrange('Mon Aug04 00:00:00 2014 CEST'::timestamptz - interval '3 days', 'Mon Aug 04 00:00:00 2014 CEST'::timestamptz), '{"[3,4]"}'),
242-
(4, tstzrange('Mon Aug 04 00:00:00 2014 CEST'::timestamptz - interval '4 days', 'Mon Aug 04 00:00:00 2014 CEST'::timestamptz), '{"[4,5]", NULL, "[40,50]"}'),
240+
(2, tstzrange('Sat Aug02 00:00:00 2014 CEST'::timestamptz, 'Mon Aug 04 00:00:00 2014 CEST'::timestamptz), '{"[2,3]", "[20,30]"}'),
241+
(3, tstzrange('Fri Aug01 00:00:00 2014 CEST'::timestamptz, 'Mon Aug 04 00:00:00 2014 CEST'::timestamptz), '{"[3,4]"}'),
242+
(4, tstzrange('Thu Jul 31 00:00:00 2014 CEST'::timestamptz, 'Mon Aug 04 00:00:00 2014 CEST'::timestamptz), '{"[4,5]", NULL, "[40,50]"}'),
243243
(5, NULL, NULL);
244244
245245
-- tst_hstore

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp