Skip to content

Commit 3165426

Browse files
committed
Remove use of deprecated containment operators in tests
Switch @ to <@ and ~ to @> in gist-related tests. The old operator names have been deprecated and will eventually (possibly soon) be removed. Author: Justin Pryzby <pryzby@telsasoft.com> Discussion: https://www.postgresql.org/message-id/flat/20201027032511.GF9241@telsasoft.com
1 parent 8c2d8f6 commit 3165426

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

src/test/regress/expected/create_am.out

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ SET enable_indexscan = ON;
4646
SET enable_bitmapscan = OFF;
4747
EXPLAIN (COSTS OFF)
4848
SELECT * FROM fast_emp4000
49-
WHERE home_base @ '(200,200),(2000,1000)'::box
49+
WHERE home_base <@ '(200,200),(2000,1000)'::box
5050
ORDER BY (home_base[0])[0];
51-
QUERY PLAN
52-
----------------------------------------------------------------
51+
QUERY PLAN
52+
-----------------------------------------------------------------
5353
Sort
5454
Sort Key: ((home_base[0])[0])
5555
-> Index Only Scan using grect2ind2 on fast_emp4000
56-
Index Cond: (home_base @ '(2000,1000),(200,200)'::box)
56+
Index Cond: (home_base <@ '(2000,1000),(200,200)'::box)
5757
(4 rows)
5858

5959
SELECT * FROM fast_emp4000
60-
WHERE home_base @ '(200,200),(2000,1000)'::box
60+
WHERE home_base <@ '(200,200),(2000,1000)'::box
6161
ORDER BY (home_base[0])[0];
6262
home_base
6363
-----------------------

src/test/regress/expected/create_index.out

+12-12
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ SET enable_seqscan = ON;
7575
SET enable_indexscan = OFF;
7676
SET enable_bitmapscan = OFF;
7777
SELECT * FROM fast_emp4000
78-
WHERE home_base @ '(200,200),(2000,1000)'::box
78+
WHERE home_base <@ '(200,200),(2000,1000)'::box
7979
ORDER BY (home_base[0])[0];
8080
home_base
8181
-----------------------
@@ -95,7 +95,7 @@ SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
9595
278
9696
(1 row)
9797

98-
SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon
98+
SELECT * FROM polygon_tbl WHERE f1 @> '((1,1),(2,2),(2,1))'::polygon
9999
ORDER BY (poly_center(f1))[0];
100100
f1
101101
---------------------
@@ -259,18 +259,18 @@ SET enable_indexscan = ON;
259259
SET enable_bitmapscan = OFF;
260260
EXPLAIN (COSTS OFF)
261261
SELECT * FROM fast_emp4000
262-
WHERE home_base @ '(200,200),(2000,1000)'::box
262+
WHERE home_base <@ '(200,200),(2000,1000)'::box
263263
ORDER BY (home_base[0])[0];
264-
QUERY PLAN
265-
----------------------------------------------------------------
264+
QUERY PLAN
265+
-----------------------------------------------------------------
266266
Sort
267267
Sort Key: ((home_base[0])[0])
268268
-> Index Only Scan using grect2ind on fast_emp4000
269-
Index Cond: (home_base @ '(2000,1000),(200,200)'::box)
269+
Index Cond: (home_base <@ '(2000,1000),(200,200)'::box)
270270
(4 rows)
271271

272272
SELECT * FROM fast_emp4000
273-
WHERE home_base @ '(200,200),(2000,1000)'::box
273+
WHERE home_base <@ '(200,200),(2000,1000)'::box
274274
ORDER BY (home_base[0])[0];
275275
home_base
276276
-----------------------
@@ -309,17 +309,17 @@ SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
309309
(1 row)
310310

311311
EXPLAIN (COSTS OFF)
312-
SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon
312+
SELECT * FROM polygon_tbl WHERE f1 @> '((1,1),(2,2),(2,1))'::polygon
313313
ORDER BY (poly_center(f1))[0];
314-
QUERY PLAN
315-
-----------------------------------------------------------
314+
QUERY PLAN
315+
------------------------------------------------------------
316316
Sort
317317
Sort Key: ((poly_center(f1))[0])
318318
-> Index Scan using gpolygonind on polygon_tbl
319-
Index Cond: (f1 ~ '((1,1),(2,2),(2,1))'::polygon)
319+
Index Cond: (f1 @> '((1,1),(2,2),(2,1))'::polygon)
320320
(4 rows)
321321

322-
SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon
322+
SELECT * FROM polygon_tbl WHERE f1 @> '((1,1),(2,2),(2,1))'::polygon
323323
ORDER BY (poly_center(f1))[0];
324324
f1
325325
---------------------

src/test/regress/sql/create_am.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ SET enable_bitmapscan = OFF;
5050

5151
EXPLAIN (COSTS OFF)
5252
SELECT * FROM fast_emp4000
53-
WHERE home_base @ '(200,200),(2000,1000)'::box
53+
WHERE home_base <@ '(200,200),(2000,1000)'::box
5454
ORDER BY (home_base[0])[0];
5555
SELECT * FROM fast_emp4000
56-
WHERE home_base @ '(200,200),(2000,1000)'::box
56+
WHERE home_base <@ '(200,200),(2000,1000)'::box
5757
ORDER BY (home_base[0])[0];
5858

5959
EXPLAIN (COSTS OFF)

src/test/regress/sql/create_index.sql

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ SET enable_indexscan = OFF;
107107
SET enable_bitmapscan = OFF;
108108

109109
SELECT * FROM fast_emp4000
110-
WHERE home_base @ '(200,200),(2000,1000)'::box
110+
WHERE home_base <@ '(200,200),(2000,1000)'::box
111111
ORDER BY (home_base[0])[0];
112112

113113
SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box;
114114

115115
SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
116116

117-
SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon
117+
SELECT * FROM polygon_tbl WHERE f1 @> '((1,1),(2,2),(2,1))'::polygon
118118
ORDER BY (poly_center(f1))[0];
119119

120120
SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1)
@@ -161,10 +161,10 @@ SET enable_bitmapscan = OFF;
161161

162162
EXPLAIN (COSTS OFF)
163163
SELECT * FROM fast_emp4000
164-
WHERE home_base @ '(200,200),(2000,1000)'::box
164+
WHERE home_base <@ '(200,200),(2000,1000)'::box
165165
ORDER BY (home_base[0])[0];
166166
SELECT * FROM fast_emp4000
167-
WHERE home_base @ '(200,200),(2000,1000)'::box
167+
WHERE home_base <@ '(200,200),(2000,1000)'::box
168168
ORDER BY (home_base[0])[0];
169169

170170
EXPLAIN (COSTS OFF)
@@ -176,9 +176,9 @@ SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
176176
SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL;
177177

178178
EXPLAIN (COSTS OFF)
179-
SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon
179+
SELECT * FROM polygon_tbl WHERE f1 @> '((1,1),(2,2),(2,1))'::polygon
180180
ORDER BY (poly_center(f1))[0];
181-
SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon
181+
SELECT * FROM polygon_tbl WHERE f1 @> '((1,1),(2,2),(2,1))'::polygon
182182
ORDER BY (poly_center(f1))[0];
183183

184184
EXPLAIN (COSTS OFF)

0 commit comments

Comments
 (0)