Fix regression errors due to ROUNDROBIN randomization
authorTomas Vondra <[email protected]>
Tue, 20 Jun 2017 20:44:03 +0000 (22:44 +0200)
committerTomas Vondra <[email protected]>
Tue, 20 Jun 2017 20:44:03 +0000 (22:44 +0200)
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.

12 files changed:
src/test/regress/expected/arrays.out
src/test/regress/expected/gist.out
src/test/regress/expected/inet.out
src/test/regress/expected/jsonb.out
src/test/regress/expected/line.out
src/test/regress/expected/rangetypes.out
src/test/regress/sql/arrays.sql
src/test/regress/sql/gist.sql
src/test/regress/sql/inet.sql
src/test/regress/sql/jsonb.sql
src/test/regress/sql/line.sql
src/test/regress/sql/rangetypes.sql

index 4a9f2ee1fda13daa1ab0bdf0394445e1bc2ec6a9..dd05bd9452bbe7c98601311c5049230a54aa0823 100644 (file)
@@ -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}}
index ca6adb869c2f27f10188c4848da9b20c008b71fe..79ead16e7fdd90a9a1141889454c073d4d6bf229 100644 (file)
@@ -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;
index d3b9bd382fbce3340f1fcbcc59e8d288178f4bff..bd5417ed8af486176dedfb5f7a218c72116d1b5e 100644 (file)
@@ -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)
 
index e0ab3d3994983cd6e3aeb39140aaa8bcb3dc0839..805840e60d6a88a24e2be647ae7da970e391b928 100644 (file)
@@ -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]]
index f20abdc4301cca3c477807420d637cbf3f4a22b7..834ce93226adb91fe24084c1748db3eeeb19123f 100644 (file)
@@ -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');
index d73fbb6b1f5631c49ef8fc26dc4556c45b95165c..264bf808f673fc746592b1d97e2956f115854209 100644 (file)
@@ -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
index 0b52fe9ad8e53384f83bb33ec2c2e5793851cdef..cf9cfd7d51404b19684f536c8067151adc9fb983 100644 (file)
@@ -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
index 9d4ff1e97e970c7b2a2558014c7765dbfaa47d94..f89d6270da3d08ffede6dcc9e0f8eb1cdd7cfeba 100644 (file)
@@ -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)),
index e3b8b3bc9ab483416c1983f3dea9caccad1f6dec..8ff73da2bb8b9f95dcb52865ecf1c230f3c6f08d 100644 (file)
@@ -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;
index fbdfbd896432655bda83d80a919ca443c8f0faa0..6cb947e96482bb37384f2a063e868d7c5d7ef366 100644 (file)
@@ -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;
 
index 94067b0cee67a32d8ee60af9f125627699574c54..8a1952387ee1cd5f8ca73b3f2240d7709e51c17d 100644 (file)
@@ -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)');
index d120aeb0d73fece1a65831159f87738efe412523..5ad88a522b21ae61d7e2609387948def36462296 100644 (file)
@@ -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)');