summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-06-20 20:44:03 +0000
committerTomas Vondra2017-06-20 20:44:03 +0000
commitb9d9a9c6b3dc4fb23e3053e6c46d8eb7be727e1b (patch)
treedd8619ea00673f48c9087c7c2412f33ab6154912
parent1d14325822e41fee5edc529ee8776a1dd22bda06 (diff)
Fix regression errors due to ROUNDROBIN randomization
Commit 1d14325822 randomized the initial node selection with ROUNDROBIN distribution, but that unexpectedly broke multiple regression tests by changing the order of returned rows (or making it unstable). In all the tests the table ends up distributed by ROUNDROBIN implicitly as the particular data type (e.g. "line" or "jsonb") does not support HASH distribution. The test data are typically inserted row-by-row, so before 1d14325822 all the rows ended up of the first datanode, which made the query order deterministic. But since 1d14325822 the rows are distributed randomly. Wherever possible, the order is made deterministic by adding ORDER BY to the queries, as usual. When not possible, because the data type does not support ordering (e.g. "line" again) the table is explicitly defined as replication.
-rw-r--r--src/test/regress/expected/arrays.out18
-rw-r--r--src/test/regress/expected/gist.out58
-rw-r--r--src/test/regress/expected/inet.out50
-rw-r--r--src/test/regress/expected/jsonb.out4
-rw-r--r--src/test/regress/expected/line.out2
-rw-r--r--src/test/regress/expected/rangetypes.out2
-rw-r--r--src/test/regress/sql/arrays.sql14
-rw-r--r--src/test/regress/sql/gist.sql2
-rw-r--r--src/test/regress/sql/inet.sql10
-rw-r--r--src/test/regress/sql/jsonb.sql4
-rw-r--r--src/test/regress/sql/line.sql2
-rw-r--r--src/test/regress/sql/rangetypes.sql2
12 files changed, 85 insertions, 83 deletions
diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out
index 4a9f2ee1fd..dd05bd9452 100644
--- a/src/test/regress/expected/arrays.out
+++ b/src/test/regress/expected/arrays.out
@@ -133,12 +133,12 @@ SELECT a[1:3],
SELECT b[1:1][2][2],
d[1:1][2]
- FROM arrtest;
+ FROM arrtest ORDER BY 1, 2;
b | d
-----------------------+---------------
- {{{113,142},{1,147}}} | {}
{} | {}
{} | {{elt1,elt2}}
+ {{{113,142},{1,147}}} | {}
(3 rows)
INSERT INTO arrtest(a) VALUES('{1,null,3}');
@@ -200,21 +200,21 @@ CREATE TEMP TABLE arrtest_s (
);
INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}');
INSERT INTO arrtest_s VALUES ('[0:4]={1,2,3,4,5}', '[0:2][0:2]={{1,2,3}, {4,5,6}, {7,8,9}}');
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
a | b
-------------------+--------------------------------------
- {1,2,3,4,5} | {{1,2,3},{4,5,6},{7,8,9}}
[0:4]={1,2,3,4,5} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}
+ {1,2,3,4,5} | {{1,2,3},{4,5,6},{7,8,9}}
(2 rows)
-SELECT a[:3], b[:2][:2] FROM arrtest_s;
+SELECT a[:3], b[:2][:2] FROM arrtest_s ORDER BY a, b;
a | b
-----------+---------------------------
{1,2,3} | {{1,2},{4,5}}
{1,2,3,4} | {{1,2,3},{4,5,6},{7,8,9}}
(2 rows)
-SELECT a[2:], b[2:][2:] FROM arrtest_s;
+SELECT a[2:], b[2:][2:] FROM arrtest_s ORDER BY a, b;
a | b
-----------+---------------
{2,3,4,5} | {{5,6},{8,9}}
@@ -231,7 +231,7 @@ SELECT a[:], b[:] FROM arrtest_s;
-- updates
UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{11,12}, {14,15}}'
WHERE array_lower(a,1) = 1;
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
a | b
-------------------+--------------------------------------
[0:4]={1,2,3,4,5} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,9}}
@@ -239,7 +239,7 @@ SELECT * FROM arrtest_s;
(2 rows)
UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{25,26}, {28,29}}';
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
a | b
---------------------+---------------------------------------
[0:4]={1,2,3,23,24} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,25}}
@@ -247,7 +247,7 @@ SELECT * FROM arrtest_s;
(2 rows)
UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}';
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
a | b
------------------------+---------------------------------------
[0:4]={11,12,13,14,15} | [0:2][0:2]={{1,2,3},{4,5,6},{7,8,25}}
diff --git a/src/test/regress/expected/gist.out b/src/test/regress/expected/gist.out
index ca6adb869c..79ead16e7f 100644
--- a/src/test/regress/expected/gist.out
+++ b/src/test/regress/expected/gist.out
@@ -20,7 +20,7 @@ vacuum analyze gist_point_tbl;
--
-- Test Index-only plans on GiST indexes
--
-create table gist_tbl (b box, p point, c circle);
+create table gist_tbl (b box, p point, c circle) distribute by replication;
insert into gist_tbl
select box(point(0.05*i, 0.05*i), point(0.05*i, 0.05*i)),
point(0.05*i, 0.05*i),
@@ -38,7 +38,7 @@ select p from gist_tbl where p <@ box(point(0,0), point(0.5, 0.5));
QUERY PLAN
--------------------------------------------------------------
Remote Fast Query Execution
- Node/s: datanode_1, datanode_2
+ Node/s: datanode_1
-> Index Only Scan using gist_tbl_point_index on gist_tbl
Index Cond: (p <@ '(0.5,0.5),(0,0)'::box)
(4 rows)
@@ -48,16 +48,16 @@ select p from gist_tbl where p <@ box(point(0,0), point(0.5, 0.5));
p
-------------
(0,0)
- (0.1,0.1)
- (0.2,0.2)
- (0.3,0.3)
- (0.4,0.4)
- (0.5,0.5)
(0.05,0.05)
+ (0.1,0.1)
(0.15,0.15)
+ (0.2,0.2)
(0.25,0.25)
+ (0.3,0.3)
(0.35,0.35)
+ (0.4,0.4)
(0.45,0.45)
+ (0.5,0.5)
(11 rows)
-- Also test an index-only knn-search
@@ -66,11 +66,12 @@ select p from gist_tbl where p <@ box(point(0,0), point(0.5, 0.5))
order by p <-> point(0.201, 0.201);
QUERY PLAN
--------------------------------------------------------------
- Remote Subquery Scan on all (datanode_1,datanode_2)
+ Remote Fast Query Execution
+ Node/s: datanode_1
-> Index Only Scan using gist_tbl_point_index on gist_tbl
Index Cond: (p <@ '(0.5,0.5),(0,0)'::box)
Order By: (p <-> '(0.201,0.201)'::point)
-(4 rows)
+(5 rows)
select p from gist_tbl where p <@ box(point(0,0), point(0.5, 0.5))
order by p <-> point(0.201, 0.201);
@@ -95,11 +96,12 @@ select p from gist_tbl where p <@ box(point(0,0), point(0.5, 0.5))
order by point(0.101, 0.101) <-> p;
QUERY PLAN
--------------------------------------------------------------
- Remote Subquery Scan on all (datanode_1,datanode_2)
+ Remote Fast Query Execution
+ Node/s: datanode_1
-> Index Only Scan using gist_tbl_point_index on gist_tbl
Index Cond: (p <@ '(0.5,0.5),(0,0)'::box)
Order By: (p <-> '(0.101,0.101)'::point)
-(4 rows)
+(5 rows)
select p from gist_tbl where p <@ box(point(0,0), point(0.5, 0.5))
order by point(0.101, 0.101) <-> p;
@@ -127,7 +129,7 @@ select b from gist_tbl where b <@ box(point(5,5), point(6,6));
QUERY PLAN
------------------------------------------------------------
Remote Fast Query Execution
- Node/s: datanode_1, datanode_2
+ Node/s: datanode_1
-> Index Only Scan using gist_tbl_box_index on gist_tbl
Index Cond: (b <@ '(6,6),(5,5)'::box)
(4 rows)
@@ -137,26 +139,26 @@ select b from gist_tbl where b <@ box(point(5,5), point(6,6));
b
-------------------------
(5,5),(5,5)
- (5.1,5.1),(5.1,5.1)
- (5.2,5.2),(5.2,5.2)
- (5.3,5.3),(5.3,5.3)
- (5.4,5.4),(5.4,5.4)
- (5.5,5.5),(5.5,5.5)
- (5.6,5.6),(5.6,5.6)
- (5.7,5.7),(5.7,5.7)
- (5.8,5.8),(5.8,5.8)
- (5.9,5.9),(5.9,5.9)
- (6,6),(6,6)
(5.05,5.05),(5.05,5.05)
+ (5.1,5.1),(5.1,5.1)
(5.15,5.15),(5.15,5.15)
+ (5.2,5.2),(5.2,5.2)
(5.25,5.25),(5.25,5.25)
+ (5.3,5.3),(5.3,5.3)
(5.35,5.35),(5.35,5.35)
+ (5.4,5.4),(5.4,5.4)
(5.45,5.45),(5.45,5.45)
+ (5.5,5.5),(5.5,5.5)
(5.55,5.55),(5.55,5.55)
+ (5.6,5.6),(5.6,5.6)
(5.65,5.65),(5.65,5.65)
+ (5.7,5.7),(5.7,5.7)
(5.75,5.75),(5.75,5.75)
+ (5.8,5.8),(5.8,5.8)
(5.85,5.85),(5.85,5.85)
+ (5.9,5.9),(5.9,5.9)
(5.95,5.95),(5.95,5.95)
+ (6,6),(6,6)
(21 rows)
drop index gist_tbl_box_index;
@@ -169,7 +171,7 @@ where p <@ box(point(5,5), point(6, 6));
QUERY PLAN
---------------------------------------------------------
Remote Fast Query Execution
- Node/s: datanode_1, datanode_2
+ Node/s: datanode_1
-> Index Scan using gist_tbl_multi_index on gist_tbl
Index Cond: (p <@ '(6,6),(5,5)'::box)
(4 rows)
@@ -181,16 +183,16 @@ and p <@ box(point(5,5), point(6, 6));
b | p
-------------------------+-------------
(5,5),(5,5) | (5,5)
- (5.1,5.1),(5.1,5.1) | (5.1,5.1)
- (5.2,5.2),(5.2,5.2) | (5.2,5.2)
- (5.3,5.3),(5.3,5.3) | (5.3,5.3)
- (5.4,5.4),(5.4,5.4) | (5.4,5.4)
- (5.5,5.5),(5.5,5.5) | (5.5,5.5)
(5.05,5.05),(5.05,5.05) | (5.05,5.05)
+ (5.1,5.1),(5.1,5.1) | (5.1,5.1)
(5.15,5.15),(5.15,5.15) | (5.15,5.15)
+ (5.2,5.2),(5.2,5.2) | (5.2,5.2)
(5.25,5.25),(5.25,5.25) | (5.25,5.25)
+ (5.3,5.3),(5.3,5.3) | (5.3,5.3)
(5.35,5.35),(5.35,5.35) | (5.35,5.35)
+ (5.4,5.4),(5.4,5.4) | (5.4,5.4)
(5.45,5.45),(5.45,5.45) | (5.45,5.45)
+ (5.5,5.5),(5.5,5.5) | (5.5,5.5)
(11 rows)
drop index gist_tbl_multi_index;
diff --git a/src/test/regress/expected/inet.out b/src/test/regress/expected/inet.out
index d3b9bd382f..bd5417ed8a 100644
--- a/src/test/regress/expected/inet.out
+++ b/src/test/regress/expected/inet.out
@@ -217,15 +217,10 @@ SELECT max(c) AS max, min(c) AS min FROM INET_TBL;
(1 row)
-- check the conversion to/from text and set_netmask
-SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL;
+SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL ORDER BY 1, 2;
ten | set_masklen
-----+------------------
- | 192.168.1.226/24
- | 192.168.1.226/24
- | 192.168.1.0/24
- | 192.168.1.0/24
- | 192.168.1.255/24
- | 192.168.1.255/24
+ | 9.1.2.3/24
| 10.1.2.3/24
| 10.1.2.3/24
| 10.1.2.3/24
@@ -233,10 +228,15 @@ SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL;
| 10.1.2.3/24
| 10.1.2.3/24
| 11.1.2.3/24
- | 9.1.2.3/24
+ | 192.168.1.0/24
+ | 192.168.1.0/24
+ | 192.168.1.226/24
+ | 192.168.1.226/24
+ | 192.168.1.255/24
+ | 192.168.1.255/24
+ | ::4.3.2.1/24
| 10:23::f1/24
| 10:23::ffff/24
- | ::4.3.2.1/24
(17 rows)
-- check that btree index works correctly
@@ -309,26 +309,26 @@ SELECT * FROM inet_tbl WHERE i >> '192.168.1.0/24'::cidr ORDER BY i;
---+---
(0 rows)
-SELECT * FROM inet_tbl WHERE i < '192.168.1.0/24'::cidr ORDER BY i;
+SELECT * FROM inet_tbl WHERE i < '192.168.1.0/24'::cidr ORDER BY i, c;
c | i
-------------+-------------
10.0.0.0/8 | 9.1.2.3/8
- 10.0.0.0/32 | 10.1.2.3/8
10.0.0.0/8 | 10.1.2.3/8
10.0.0.0/8 | 10.1.2.3/8
+ 10.0.0.0/32 | 10.1.2.3/8
10.1.0.0/16 | 10.1.2.3/16
10.1.2.0/24 | 10.1.2.3/24
10.1.2.3/32 | 10.1.2.3
10.0.0.0/8 | 11.1.2.3/8
(8 rows)
-SELECT * FROM inet_tbl WHERE i <= '192.168.1.0/24'::cidr ORDER BY i;
+SELECT * FROM inet_tbl WHERE i <= '192.168.1.0/24'::cidr ORDER BY i, c;
c | i
----------------+----------------
10.0.0.0/8 | 9.1.2.3/8
10.0.0.0/8 | 10.1.2.3/8
- 10.0.0.0/32 | 10.1.2.3/8
10.0.0.0/8 | 10.1.2.3/8
+ 10.0.0.0/32 | 10.1.2.3/8
10.1.0.0/16 | 10.1.2.3/16
10.1.2.0/24 | 10.1.2.3/24
10.1.2.3/32 | 10.1.2.3
@@ -369,13 +369,13 @@ SELECT * FROM inet_tbl WHERE i > '192.168.1.0/24'::cidr ORDER BY i;
10:23::8000/113 | 10:23::ffff
(8 rows)
-SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr ORDER BY i;
+SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr ORDER BY i, c;
c | i
--------------------+------------------
10.0.0.0/8 | 9.1.2.3/8
10.0.0.0/8 | 10.1.2.3/8
- 10.0.0.0/32 | 10.1.2.3/8
10.0.0.0/8 | 10.1.2.3/8
+ 10.0.0.0/32 | 10.1.2.3/8
10.1.0.0/16 | 10.1.2.3/16
10.1.2.0/24 | 10.1.2.3/24
10.1.2.3/32 | 10.1.2.3
@@ -623,25 +623,25 @@ INSERT INTO INET_TBL (c, i) VALUES ('10', '10::/8');
SELECT inet_merge(c, i) FROM INET_TBL;
ERROR: cannot merge addresses from different families
-- fix it by inet_same_family() condition
-SELECT inet_merge(c, i) FROM INET_TBL WHERE inet_same_family(c, i);
+SELECT inet_merge(c, i) FROM INET_TBL WHERE inet_same_family(c, i) ORDER BY 1;
inet_merge
-----------------
+ 8.0.0.0/6
+ 10.0.0.0/7
+ 10.0.0.0/8
+ 10.0.0.0/8
+ 10.0.0.0/8
+ 10.1.0.0/16
+ 10.1.2.0/24
+ 10.1.2.3/32
192.168.1.0/24
192.168.1.0/24
192.168.1.0/24
192.168.1.0/24
192.168.1.0/24
192.168.1.0/24
- 10.0.0.0/8
- 10.0.0.0/8
- 10.1.2.3/32
- 10.1.2.0/24
- 10.1.0.0/16
- 10.0.0.0/8
- 10.0.0.0/7
- 8.0.0.0/6
+ ::/24
10:23::/64
10:23::8000/113
- ::/24
(17 rows)
diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out
index e0ab3d3994..805840e60d 100644
--- a/src/test/regress/expected/jsonb.out
+++ b/src/test/regress/expected/jsonb.out
@@ -2470,7 +2470,7 @@ select * from nestjsonb where j @> '{"c":3}';
{"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
(1 row)
-select * from nestjsonb where j @> '[[14]]';
+select * from nestjsonb where j @> '[[14]]' order by j;
j
-----------------
[[14, 2, 3]]
@@ -2491,7 +2491,7 @@ select * from nestjsonb where j @> '{"c":3}';
{"a": [["b", {"x": 1}], ["b", {"x": 2}]], "c": 3}
(1 row)
-select * from nestjsonb where j @> '[[14]]';
+select * from nestjsonb where j @> '[[14]]' order by j;
j
-----------------
[[14, 2, 3]]
diff --git a/src/test/regress/expected/line.out b/src/test/regress/expected/line.out
index f20abdc430..834ce93226 100644
--- a/src/test/regress/expected/line.out
+++ b/src/test/regress/expected/line.out
@@ -3,7 +3,7 @@
-- Infinite lines
--
--DROP TABLE LINE_TBL;
-CREATE TABLE LINE_TBL (s line);
+CREATE TABLE LINE_TBL (s line) DISTRIBUTE BY REPLICATION;
INSERT INTO LINE_TBL VALUES ('{1,-1,1}');
INSERT INTO LINE_TBL VALUES ('(0,0),(6,6)');
INSERT INTO LINE_TBL VALUES ('10,-10 ,-5,-4');
diff --git a/src/test/regress/expected/rangetypes.out b/src/test/regress/expected/rangetypes.out
index d73fbb6b1f..264bf808f6 100644
--- a/src/test/regress/expected/rangetypes.out
+++ b/src/test/regress/expected/rangetypes.out
@@ -1135,7 +1135,7 @@ create table test_range_excl(
during tsrange,
exclude using gist (room with =, during with &&),
exclude using gist (speaker with =, during with &&)
-);
+) distribute by replication;
insert into test_range_excl
values(int4range(123, 123, '[]'), int4range(1, 1, '[]'), '[2010-01-02 10:00, 2010-01-02 11:00)');
insert into test_range_excl
diff --git a/src/test/regress/sql/arrays.sql b/src/test/regress/sql/arrays.sql
index 0b52fe9ad8..cf9cfd7d51 100644
--- a/src/test/regress/sql/arrays.sql
+++ b/src/test/regress/sql/arrays.sql
@@ -94,7 +94,7 @@ SELECT a[1:3],
SELECT b[1:1][2][2],
d[1:1][2]
- FROM arrtest;
+ FROM arrtest ORDER BY 1, 2;
INSERT INTO arrtest(a) VALUES('{1,null,3}');
SELECT a FROM arrtest ORDER BY 1;
@@ -117,19 +117,19 @@ CREATE TEMP TABLE arrtest_s (
INSERT INTO arrtest_s VALUES ('{1,2,3,4,5}', '{{1,2,3}, {4,5,6}, {7,8,9}}');
INSERT INTO arrtest_s VALUES ('[0:4]={1,2,3,4,5}', '[0:2][0:2]={{1,2,3}, {4,5,6}, {7,8,9}}');
-SELECT * FROM arrtest_s;
-SELECT a[:3], b[:2][:2] FROM arrtest_s;
-SELECT a[2:], b[2:][2:] FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
+SELECT a[:3], b[:2][:2] FROM arrtest_s ORDER BY a, b;
+SELECT a[2:], b[2:][2:] FROM arrtest_s ORDER BY a, b;
SELECT a[:], b[:] FROM arrtest_s;
-- updates
UPDATE arrtest_s SET a[:3] = '{11, 12, 13}', b[:2][:2] = '{{11,12}, {14,15}}'
WHERE array_lower(a,1) = 1;
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
UPDATE arrtest_s SET a[3:] = '{23, 24, 25}', b[2:][2:] = '{{25,26}, {28,29}}';
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}';
-SELECT * FROM arrtest_s;
+SELECT * FROM arrtest_s ORDER BY a, b;
UPDATE arrtest_s SET a[:] = '{23, 24, 25}'; -- fail, too small
INSERT INTO arrtest_s VALUES(NULL, NULL);
UPDATE arrtest_s SET a[:] = '{11, 12, 13, 14, 15}'; -- fail, no good with null
diff --git a/src/test/regress/sql/gist.sql b/src/test/regress/sql/gist.sql
index 9d4ff1e97e..f89d6270da 100644
--- a/src/test/regress/sql/gist.sql
+++ b/src/test/regress/sql/gist.sql
@@ -29,7 +29,7 @@ vacuum analyze gist_point_tbl;
-- Test Index-only plans on GiST indexes
--
-create table gist_tbl (b box, p point, c circle);
+create table gist_tbl (b box, p point, c circle) distribute by replication;
insert into gist_tbl
select box(point(0.05*i, 0.05*i), point(0.05*i, 0.05*i)),
diff --git a/src/test/regress/sql/inet.sql b/src/test/regress/sql/inet.sql
index e3b8b3bc9a..8ff73da2bb 100644
--- a/src/test/regress/sql/inet.sql
+++ b/src/test/regress/sql/inet.sql
@@ -60,7 +60,7 @@ SELECT max(i) AS max, min(i) AS min FROM INET_TBL;
SELECT max(c) AS max, min(c) AS min FROM INET_TBL;
-- check the conversion to/from text and set_netmask
-SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL;
+SELECT '' AS ten, set_masklen(inet(text(i)), 24) FROM INET_TBL ORDER BY 1, 2;
-- check that btree index works correctly
CREATE INDEX inet_idx1 ON inet_tbl(i);
@@ -78,12 +78,12 @@ SELECT * FROM inet_tbl WHERE i <<= '192.168.1.0/24'::cidr ORDER BY i;
SELECT * FROM inet_tbl WHERE i && '192.168.1.0/24'::cidr ORDER BY i;
SELECT * FROM inet_tbl WHERE i >>= '192.168.1.0/24'::cidr ORDER BY i;
SELECT * FROM inet_tbl WHERE i >> '192.168.1.0/24'::cidr ORDER BY i;
-SELECT * FROM inet_tbl WHERE i < '192.168.1.0/24'::cidr ORDER BY i;
-SELECT * FROM inet_tbl WHERE i <= '192.168.1.0/24'::cidr ORDER BY i;
+SELECT * FROM inet_tbl WHERE i < '192.168.1.0/24'::cidr ORDER BY i, c;
+SELECT * FROM inet_tbl WHERE i <= '192.168.1.0/24'::cidr ORDER BY i, c;
SELECT * FROM inet_tbl WHERE i = '192.168.1.0/24'::cidr ORDER BY i;
SELECT * FROM inet_tbl WHERE i >= '192.168.1.0/24'::cidr ORDER BY i;
SELECT * FROM inet_tbl WHERE i > '192.168.1.0/24'::cidr ORDER BY i;
-SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr ORDER BY i;
+SELECT * FROM inet_tbl WHERE i <> '192.168.1.0/24'::cidr ORDER BY i, c;
-- test index-only scans
EXPLAIN (COSTS OFF)
@@ -122,4 +122,4 @@ INSERT INTO INET_TBL (c, i) VALUES ('10', '10::/8');
-- now, this one should fail
SELECT inet_merge(c, i) FROM INET_TBL;
-- fix it by inet_same_family() condition
-SELECT inet_merge(c, i) FROM INET_TBL WHERE inet_same_family(c, i);
+SELECT inet_merge(c, i) FROM INET_TBL WHERE inet_same_family(c, i) ORDER BY 1;
diff --git a/src/test/regress/sql/jsonb.sql b/src/test/regress/sql/jsonb.sql
index fbdfbd8964..6cb947e964 100644
--- a/src/test/regress/sql/jsonb.sql
+++ b/src/test/regress/sql/jsonb.sql
@@ -643,12 +643,12 @@ set enable_seqscan = on;
set enable_bitmapscan = off;
select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
select * from nestjsonb where j @> '{"c":3}';
-select * from nestjsonb where j @> '[[14]]';
+select * from nestjsonb where j @> '[[14]]' order by j;
set enable_seqscan = off;
set enable_bitmapscan = on;
select * from nestjsonb where j @> '{"a":[[{"x":2}]]}'::jsonb;
select * from nestjsonb where j @> '{"c":3}';
-select * from nestjsonb where j @> '[[14]]';
+select * from nestjsonb where j @> '[[14]]' order by j;
reset enable_seqscan;
reset enable_bitmapscan;
diff --git a/src/test/regress/sql/line.sql b/src/test/regress/sql/line.sql
index 94067b0cee..8a1952387e 100644
--- a/src/test/regress/sql/line.sql
+++ b/src/test/regress/sql/line.sql
@@ -4,7 +4,7 @@
--
--DROP TABLE LINE_TBL;
-CREATE TABLE LINE_TBL (s line);
+CREATE TABLE LINE_TBL (s line) DISTRIBUTE BY REPLICATION;
INSERT INTO LINE_TBL VALUES ('{1,-1,1}');
INSERT INTO LINE_TBL VALUES ('(0,0),(6,6)');
diff --git a/src/test/regress/sql/rangetypes.sql b/src/test/regress/sql/rangetypes.sql
index d120aeb0d7..5ad88a522b 100644
--- a/src/test/regress/sql/rangetypes.sql
+++ b/src/test/regress/sql/rangetypes.sql
@@ -320,7 +320,7 @@ create table test_range_excl(
during tsrange,
exclude using gist (room with =, during with &&),
exclude using gist (speaker with =, during with &&)
-);
+) distribute by replication;
insert into test_range_excl
values(int4range(123, 123, '[]'), int4range(1, 1, '[]'), '[2010-01-02 10:00, 2010-01-02 11:00)');