Permalink
Browse files

Fix for regression test xc_groupby

Results are made cluster-consistent by adding some ORDER BY clauses
on some queries.
  • Loading branch information...
1 parent fd2cc85 commit cc46dfcc52ff5a60818b168716dab4a6fd9b68d9 @michaelpq michaelpq committed Apr 10, 2012
Showing with 52 additions and 52 deletions.
  1. +41 −41 src/test/regress/expected/xc_groupby.out
  2. +11 −11 src/test/regress/sql/xc_groupby.sql
@@ -104,15 +104,15 @@ explain (verbose true, costs false, nodes false) select val2 from xc_groupby_tab
Remote query: SELECT group_1.val2 FROM (SELECT val, val2 FROM ONLY xc_groupby_tab1 WHERE true) group_1 GROUP BY 1
(7 rows)
-select val + val2 from xc_groupby_tab1 group by val + val2;
+select val + val2 from xc_groupby_tab1 group by val + val2 order by 1;
?column?
----------
+ 2
+ 3
4
7
- 3
8
9
- 2
(6 rows)
explain (verbose true, costs false, nodes false) select val + val2 from xc_groupby_tab1 group by val + val2;
@@ -127,15 +127,15 @@ explain (verbose true, costs false, nodes false) select val + val2 from xc_group
Remote query: SELECT (group_1.val + group_1.val2) FROM (SELECT val, val2 FROM ONLY xc_groupby_tab1 WHERE true) group_1 GROUP BY 1
(7 rows)
-select val + val2, val, val2 from xc_groupby_tab1 group by val, val2;
+select val + val2, val, val2 from xc_groupby_tab1 group by val, val2 order by 1,2,3;
?column? | val | val2
----------+-----+------
- 7 | 4 | 3
- 4 | 3 | 1
- 4 | 2 | 2
+ 2 | 1 | 1
3 | 2 | 1
4 | 1 | 3
- 2 | 1 | 1
+ 4 | 2 | 2
+ 4 | 3 | 1
+ 7 | 4 | 3
8 | 6 | 2
9 | 6 | 3
(8 rows)
@@ -152,14 +152,14 @@ explain (verbose true, costs false, nodes false) select val + val2, val, val2 fr
Remote query: SELECT (group_1.val + group_1.val2), group_1.val, group_1.val2 FROM (SELECT val, val2 FROM ONLY xc_groupby_tab1 WHERE true) group_1 GROUP BY 2, 3
(7 rows)
-select xc_groupby_tab1.val + xc_groupby_tab2.val2, xc_groupby_tab1.val, xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val, xc_groupby_tab2.val2;
+select xc_groupby_tab1.val + xc_groupby_tab2.val2, xc_groupby_tab1.val, xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val, xc_groupby_tab2.val2 order by 1,2,3;
?column? | val | val2
----------+-----+------
+ 2 | 1 | 1
5 | 3 | 2
5 | 4 | 1
- 6 | 4 | 2
6 | 2 | 4
- 2 | 1 | 1
+ 6 | 4 | 2
7 | 3 | 4
(6 rows)
@@ -286,36 +286,36 @@ explain (verbose true, costs false, nodes false) select a,count(a) from xc_group
Remote query: SELECT a, b FROM ONLY xc_groupby_def WHERE true
(10 rows)
-select avg(a) from xc_groupby_def group by a;
+select avg(a) from xc_groupby_def group by a order by 1;
avg
------------------------
-
- 6.0000000000000000
- 8.0000000000000000
- 5.0000000000000000
1.00000000000000000000
- 9.0000000000000000
2.0000000000000000
- 10.0000000000000000
- 7.0000000000000000
3.0000000000000000
4.0000000000000000
+ 5.0000000000000000
+ 6.0000000000000000
+ 7.0000000000000000
+ 8.0000000000000000
+ 9.0000000000000000
+ 10.0000000000000000
+
(11 rows)
-select avg(a) from xc_groupby_def group by a;
+select avg(a) from xc_groupby_def group by a order by 1;
avg
------------------------
-
- 6.0000000000000000
- 8.0000000000000000
- 5.0000000000000000
1.00000000000000000000
- 9.0000000000000000
2.0000000000000000
- 10.0000000000000000
- 7.0000000000000000
3.0000000000000000
4.0000000000000000
+ 5.0000000000000000
+ 6.0000000000000000
+ 7.0000000000000000
+ 8.0000000000000000
+ 9.0000000000000000
+ 10.0000000000000000
+
(11 rows)
explain (verbose true, costs false, nodes false) select avg(a) from xc_groupby_def group by a;
@@ -330,13 +330,13 @@ explain (verbose true, costs false, nodes false) select avg(a) from xc_groupby_d
Remote query: SELECT avg(group_1.a), group_1.a FROM (SELECT a, b FROM ONLY xc_groupby_def WHERE true) group_1 GROUP BY 2
(7 rows)
-select avg(a) from xc_groupby_def group by b;
+select avg(a) from xc_groupby_def group by b order by 1;
avg
--------------------
4.0000000000000000
-
4.5000000000000000
6.2000000000000000
+
(4 rows)
explain (verbose true, costs false, nodes false) select avg(a) from xc_groupby_def group by b;
@@ -351,13 +351,13 @@ explain (verbose true, costs false, nodes false) select avg(a) from xc_groupby_d
Remote query: SELECT avg(group_1.a), group_1.b FROM (SELECT a, b FROM ONLY xc_groupby_def WHERE true) group_1 GROUP BY 2
(7 rows)
-select sum(a) from xc_groupby_def group by b;
+select sum(a) from xc_groupby_def group by b order by 1;
sum
-----
8
-
18
31
+
(4 rows)
explain (verbose true, costs false, nodes false) select sum(a) from xc_groupby_def group by b;
@@ -372,11 +372,11 @@ explain (verbose true, costs false, nodes false) select sum(a) from xc_groupby_d
Remote query: SELECT sum(group_1.a), group_1.b FROM (SELECT a, b FROM ONLY xc_groupby_def WHERE true) group_1 GROUP BY 2
(7 rows)
-select count(*) from xc_groupby_def group by b;
+select count(*) from xc_groupby_def group by b order by 1;
count
-------
- 3
1
+ 3
4
5
(4 rows)
@@ -393,19 +393,19 @@ explain (verbose true, costs false, nodes false) select count(*) from xc_groupby
Remote query: SELECT count(*), group_1.b FROM (SELECT a, b FROM ONLY xc_groupby_def WHERE true) group_1 GROUP BY 2
(7 rows)
-select count(*) from xc_groupby_def where a is not null group by a;
+select count(*) from xc_groupby_def where a is not null group by a order by 1;
count
-------
1
1
1
1
- 2
1
1
1
1
1
+ 2
(10 rows)
explain (verbose true, costs false, nodes false) select count(*) from xc_groupby_def where a is not null group by a;
@@ -420,13 +420,13 @@ explain (verbose true, costs false, nodes false) select count(*) from xc_groupby
Remote query: SELECT count(*), group_1.a FROM (SELECT a, b FROM ONLY xc_groupby_def WHERE (a IS NOT NULL)) group_1 GROUP BY 2
(7 rows)
-select b from xc_groupby_def group by b;
+select b from xc_groupby_def group by b order by 1;
b
-------
-
One
- Two
Three
+ Two
+
(4 rows)
explain (verbose true, costs false, nodes false) select b from xc_groupby_def group by b;
@@ -441,13 +441,13 @@ explain (verbose true, costs false, nodes false) select b from xc_groupby_def gr
Remote query: SELECT group_1.b FROM (SELECT a, b FROM ONLY xc_groupby_def WHERE true) group_1 GROUP BY 1
(7 rows)
-select b,count(b) from xc_groupby_def group by b;
+select b,count(b) from xc_groupby_def group by b order by 1,2;
b | count
-------+-------
- | 0
One | 1
- Two | 4
Three | 5
+ Two | 4
+ | 0
(4 rows)
explain (verbose true, costs false, nodes false) select b,count(b) from xc_groupby_def group by b;
@@ -26,11 +26,11 @@ explain (verbose true, costs false, nodes false) select sum(y) from (select sum(
-- group by without aggregate
select val2 from xc_groupby_tab1 group by val2;
explain (verbose true, costs false, nodes false) select val2 from xc_groupby_tab1 group by val2;
-select val + val2 from xc_groupby_tab1 group by val + val2;
+select val + val2 from xc_groupby_tab1 group by val + val2 order by 1;
explain (verbose true, costs false, nodes false) select val + val2 from xc_groupby_tab1 group by val + val2;
-select val + val2, val, val2 from xc_groupby_tab1 group by val, val2;
+select val + val2, val, val2 from xc_groupby_tab1 group by val, val2 order by 1,2,3;
explain (verbose true, costs false, nodes false) select val + val2, val, val2 from xc_groupby_tab1 group by val, val2;
-select xc_groupby_tab1.val + xc_groupby_tab2.val2, xc_groupby_tab1.val, xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val, xc_groupby_tab2.val2;
+select xc_groupby_tab1.val + xc_groupby_tab2.val2, xc_groupby_tab1.val, xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val, xc_groupby_tab2.val2 order by 1,2,3;
explain (verbose true, costs false, nodes false) select xc_groupby_tab1.val + xc_groupby_tab2.val2, xc_groupby_tab1.val, xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val, xc_groupby_tab2.val2;
select xc_groupby_tab1.val + xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val + xc_groupby_tab2.val2;
explain (verbose true, costs false, nodes false) select xc_groupby_tab1.val + xc_groupby_tab2.val2 from xc_groupby_tab1, xc_groupby_tab2 where xc_groupby_tab1.val = xc_groupby_tab2.val group by xc_groupby_tab1.val + xc_groupby_tab2.val2;
@@ -61,21 +61,21 @@ insert into xc_groupby_def VALUES (10, 'Three');
select a,count(a) from xc_groupby_def group by a order by a;
explain (verbose true, costs false, nodes false) select a,count(a) from xc_groupby_def group by a order by a;
-select avg(a) from xc_groupby_def group by a;
-select avg(a) from xc_groupby_def group by a;
+select avg(a) from xc_groupby_def group by a order by 1;
+select avg(a) from xc_groupby_def group by a order by 1;
explain (verbose true, costs false, nodes false) select avg(a) from xc_groupby_def group by a;
-select avg(a) from xc_groupby_def group by b;
+select avg(a) from xc_groupby_def group by b order by 1;
explain (verbose true, costs false, nodes false) select avg(a) from xc_groupby_def group by b;
-select sum(a) from xc_groupby_def group by b;
+select sum(a) from xc_groupby_def group by b order by 1;
explain (verbose true, costs false, nodes false) select sum(a) from xc_groupby_def group by b;
-select count(*) from xc_groupby_def group by b;
+select count(*) from xc_groupby_def group by b order by 1;
explain (verbose true, costs false, nodes false) select count(*) from xc_groupby_def group by b;
-select count(*) from xc_groupby_def where a is not null group by a;
+select count(*) from xc_groupby_def where a is not null group by a order by 1;
explain (verbose true, costs false, nodes false) select count(*) from xc_groupby_def where a is not null group by a;
-select b from xc_groupby_def group by b;
+select b from xc_groupby_def group by b order by 1;
explain (verbose true, costs false, nodes false) select b from xc_groupby_def group by b;
-select b,count(b) from xc_groupby_def group by b;
+select b,count(b) from xc_groupby_def group by b order by 1,2;
explain (verbose true, costs false, nodes false) select b,count(b) from xc_groupby_def group by b;
select count(*) from xc_groupby_def where b is null group by b;
explain (verbose true, costs false, nodes false) select count(*) from xc_groupby_def where b is null group by b;

0 comments on commit cc46dfc

Please sign in to comment.