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

Commit 1f075a3

Browse files
author
Thomas G. Lockhart
committed
Add separate regression tests for timetz and the new timestamptz type.
Modify the timestamp test to reflect the "no time zone" behavior of this new code; timestamptz resembles the old timestamp code.
1 parent 44f1833 commit 1f075a3

21 files changed

+4076
-2016
lines changed

src/test/regress/expected/abstime.out

+23-24
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,20 @@
99
-- daylight savings time right for times prior to Unix epoch (jan 1 1970).
1010
--
1111
CREATE TABLE ABSTIME_TBL (f1 abstime);
12+
BEGIN;
13+
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'current');
14+
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now');
15+
SELECT count(*) AS two FROM ABSTIME_TBL WHERE f1 = 'now' ;
16+
two
17+
-----
18+
2
19+
(1 row)
20+
21+
END;
22+
DELETE FROM ABSTIME_TBL;
1223
INSERT INTO ABSTIME_TBL (f1) VALUES ('Jan 14, 1973 03:14:21');
13-
-- was INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'now'):
1424
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'Mon May 1 00:30:30 1995');
1525
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'epoch');
16-
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'current');
1726
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'infinity');
1827
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime '-infinity');
1928
INSERT INTO ABSTIME_TBL (f1) VALUES (abstime 'May 10, 1947 23:59:12');
@@ -32,21 +41,20 @@ SELECT '' AS eight, ABSTIME_TBL.*;
3241
-------+------------------------------
3342
| Sun Jan 14 03:14:21 1973 PST
3443
| Mon May 01 00:30:30 1995 PDT
35-
| epoch
36-
| current
44+
| Wed Dec 31 16:00:00 1969 PST
3745
| infinity
3846
| -infinity
3947
| Sat May 10 23:59:12 1947 PST
4048
| invalid
41-
(8 rows)
49+
(7 rows)
4250

4351
SELECT '' AS six, ABSTIME_TBL.*
4452
WHERE ABSTIME_TBL.f1 < abstime 'Jun 30, 2001';
4553
six | f1
4654
-----+------------------------------
4755
| Sun Jan 14 03:14:21 1973 PST
4856
| Mon May 01 00:30:30 1995 PDT
49-
| epoch
57+
| Wed Dec 31 16:00:00 1969 PST
5058
| -infinity
5159
| Sat May 10 23:59:12 1947 PST
5260
(5 rows)
@@ -57,38 +65,29 @@ SELECT '' AS six, ABSTIME_TBL.*
5765
-----+------------------------------
5866
| Sun Jan 14 03:14:21 1973 PST
5967
| Mon May 01 00:30:30 1995 PDT
60-
| epoch
61-
| current
68+
| Wed Dec 31 16:00:00 1969 PST
6269
| infinity
6370
| Sat May 10 23:59:12 1947 PST
6471
| invalid
65-
(7 rows)
72+
(6 rows)
6673

6774
SELECT '' AS six, ABSTIME_TBL.*
6875
WHERE abstime 'May 10, 1947 23:59:12' <> ABSTIME_TBL.f1;
6976
six | f1
7077
-----+------------------------------
7178
| Sun Jan 14 03:14:21 1973 PST
7279
| Mon May 01 00:30:30 1995 PDT
73-
| epoch
74-
| current
80+
| Wed Dec 31 16:00:00 1969 PST
7581
| infinity
7682
| -infinity
7783
| invalid
78-
(7 rows)
79-
80-
SELECT '' AS one, ABSTIME_TBL.*
81-
WHERE abstime 'current' = ABSTIME_TBL.f1;
82-
one | f1
83-
-----+---------
84-
| current
85-
(1 row)
84+
(6 rows)
8685

8786
SELECT '' AS three, ABSTIME_TBL.*
8887
WHERE abstime 'epoch' >= ABSTIME_TBL.f1;
8988
three | f1
9089
-------+------------------------------
91-
| epoch
90+
| Wed Dec 31 16:00:00 1969 PST
9291
| -infinity
9392
| Sat May 10 23:59:12 1947 PST
9493
(3 rows)
@@ -98,7 +97,7 @@ SELECT '' AS four, ABSTIME_TBL.*
9897
four | f1
9998
------+------------------------------
10099
| Sun Jan 14 03:14:21 1973 PST
101-
| epoch
100+
| Wed Dec 31 16:00:00 1969 PST
102101
| -infinity
103102
| Sat May 10 23:59:12 1947 PST
104103
(4 rows)
@@ -110,20 +109,20 @@ SELECT '' AS four, ABSTIME_TBL.*
110109
------+------------------------------
111110
| Sun Jan 14 03:14:21 1973 PST
112111
| Mon May 01 00:30:30 1995 PDT
113-
| epoch
112+
| Wed Dec 31 16:00:00 1969 PST
114113
(3 rows)
115114

116115
SELECT '' AS four, f1 AS abstime,
117116
date_part('year', f1) AS year, date_part('month', f1) AS month,
118117
date_part('day',f1) AS day, date_part('hour', f1) AS hour,
119118
date_part('minute', f1) AS minute, date_part('second', f1) AS second
120119
FROM ABSTIME_TBL
121-
WHERE isfinite(f1) and f1 <> abstime 'current'
120+
WHERE isfinite(f1)
122121
ORDER BY abstime;
123122
four | abstime | year | month | day | hour | minute | second
124123
------+------------------------------+------+-------+-----+------+--------+--------
125124
| Sat May 10 23:59:12 1947 PST | 1947 | 5 | 10 | 23 | 59 | 12
126-
| epoch | 1969 | 12 | 31 | 16 | 0 | 0
125+
| Wed Dec 31 16:00:00 1969 PST | 1969 | 12 | 31 | 16 | 0 | 0
127126
| Sun Jan 14 03:14:21 1973 PST | 1973 | 1 | 14 | 3 | 14 | 21
128127
| Mon May 01 00:30:30 1995 PDT | 1995 | 5 | 1 | 0 | 30 | 30
129128
(4 rows)

src/test/regress/expected/geometry.out

+26-26
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
127127
| (-5,-12) | [(10,-10),(-3,-4)] | (-1.60487804878049,-4.64390243902439)
128128
| (10,10) | [(10,-10),(-3,-4)] | (2.39024390243902,-6.48780487804878)
129129
| (0,0) | [(-1000000,200),(300000,-40)] | (0.0028402365895872,15.384614860264)
130-
| (-10,0) | [(-1000000,200),(300000,-40)] | (-9.99715942258202,15.3864610140472)
130+
| (-10,0) | [(-1000000,200),(300000,-40)] | (-9.99715942258202,15.3864610140473)
131131
| (-3,4) | [(-1000000,200),(300000,-40)] | (-2.99789812267519,15.3851688427303)
132132
| (5.1,34.5) | [(-1000000,200),(300000,-40)] | (5.09647083221496,15.3836744976925)
133133
| (-5,-12) | [(-1000000,200),(300000,-40)] | (-4.99494420845634,15.3855375281616)
@@ -152,7 +152,7 @@ SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL;
152152
| (2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964)
153153
| (71.7106781186548,72.7106781186548),(-69.7106781186548,-68.7106781186548)
154154
| (4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932738)
155-
| (3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559643)
155+
| (3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559642)
156156
| (107.071067811865,207.071067811865),(92.9289321881345,192.928932188135)
157157
| (170.710678118655,70.7106781186548),(29.2893218813452,-70.7106781186548)
158158
(6 rows)
@@ -502,31 +502,31 @@ SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS d
502502
FROM CIRCLE_TBL c1, POINT_TBL p1
503503
WHERE (p1.f1 <-> c1.f1) > 0
504504
ORDER BY distance, circle, point using <<;
505-
twentyfour | circle | point | distance
505+
twentyfour | circle | point | distance
506506
------------+----------------+------------+-------------------
507-
| <(100,0),100> | (5.1,34.5) | 0.976531926977964
508-
| <(1,2),3> | (-3,4) | 1.47213595499958
509-
| <(0,0),3> | (-3,4) | 2
507+
| <(100,0),100> | (5.1,34.5) | 0.976531926977965
508+
| <(1,2),3> | (-3,4) | 1.47213595499958
509+
| <(0,0),3> | (-3,4) | 2
510510
| <(100,0),100> | (-3,4) | 3.07764064044151
511-
| <(100,0),100> | (-5,-12) | 5.68348972285122
512-
| <(1,3),5> | (-10,0) | 6.40175425099138
513-
| <(1,3),5> | (10,10) | 6.40175425099138
514-
| <(0,0),3> | (-10,0) | 7
515-
| <(1,2),3> | (-10,0) | 8.18033988749895
516-
| <(1,2),3> | (10,10) | 9.0415945787923
517-
| <(0,0),3> | (-5,-12) | 10
518-
| <(100,0),100> | (-10,0) | 10
519-
| <(0,0),3> | (10,10) | 11.142135623731
520-
| <(1,3),5> | (-5,-12) | 11.1554944214035
521-
| <(1,2),3> | (-5,-12) | 12.2315462117278
522-
| <(1,3),5> | (5.1,34.5) | 26.7657047773224
523-
| <(1,2),3> | (5.1,34.5) | 29.757594539282
524-
| <(0,0),3> | (5.1,34.5) | 31.8749193547455
525-
| <(100,200),10> | (5.1,34.5) | 180.778038568384
526-
| <(100,200),10> | (10,10) | 200.237960416286
527-
| <(100,200),10> | (-3,4) | 211.415898254845
528-
| <(100,200),10> | (0,0) | 213.606797749979
529-
| <(100,200),10> | (-10,0) | 218.254244210267
530-
| <(100,200),10> | (-5,-12) | 226.577682802077
511+
| <(100,0),100> | (-5,-12) | 5.68348972285122
512+
| <(1,3),5> | (-10,0) | 6.40175425099138
513+
| <(1,3),5> | (10,10) | 6.40175425099138
514+
| <(0,0),3> | (-10,0) | 7
515+
| <(1,2),3> | (-10,0) | 8.18033988749895
516+
| <(1,2),3> | (10,10) | 9.0415945787923
517+
| <(0,0),3> | (-5,-12) | 10
518+
| <(100,0),100> | (-10,0) | 10
519+
| <(0,0),3> | (10,10) | 11.142135623731
520+
| <(1,3),5> | (-5,-12) | 11.1554944214035
521+
| <(1,2),3> | (-5,-12) | 12.2315462117278
522+
| <(1,3),5> | (5.1,34.5) | 26.7657047773223
523+
| <(1,2),3> | (5.1,34.5) | 29.757594539282
524+
| <(0,0),3> | (5.1,34.5) | 31.8749193547455
525+
| <(100,200),10> | (5.1,34.5) | 180.778038568384
526+
| <(100,200),10> | (10,10) | 200.237960416286
527+
| <(100,200),10> | (-3,4) | 211.415898254845
528+
| <(100,200),10> | (0,0) | 213.606797749979
529+
| <(100,200),10> | (-10,0) | 218.254244210267
530+
| <(100,200),10> | (-5,-12) | 226.577682802077
531531
(24 rows)
532532

0 commit comments

Comments
 (0)