summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-07-15 00:02:07 +0000
committerTomas Vondra2017-07-15 00:02:07 +0000
commit0816b22b44abb0599f2521d66b7a62a2f69d01a6 (patch)
tree2a144107ff15797a5d16cb1d6ea92075575fbc64
parent2b87e40619ca0ad94741ca2d511720fdac44e0f9 (diff)
Stabilize ordering and accept plan in domain test
Trivial result ordering stabilization by adding ORDER BY clause, and accepting explain output with additional Remote Subquery node (on top of the upstream plan).
-rw-r--r--src/test/regress/expected/domain.out25
-rw-r--r--src/test/regress/sql/domain.sql2
2 files changed, 15 insertions, 12 deletions
diff --git a/src/test/regress/expected/domain.out b/src/test/regress/expected/domain.out
index ac204c9eca..409c28d764 100644
--- a/src/test/regress/expected/domain.out
+++ b/src/test/regress/expected/domain.out
@@ -115,8 +115,8 @@ select * from domarrtest order by 1, 2;
{2,2} | {{a,b},{c,d},{e,f}}
{2,2} | {{a},{c}}
{{2,2},{2,2}} | {{a,b}}
- | {{a,b,c},{d,e,f}}
{11,NULL,22} |
+ | {{a,b,c},{d,e,f}}
(6 rows)
select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
@@ -125,9 +125,9 @@ select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
2 | {{c}}
2 | {{c,d}}
2 | {{c,d}}
+ 11 |
| {}
| {{d,e,f}}
- 11 |
(6 rows)
select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order by 1, 2;
@@ -137,8 +137,8 @@ select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order b
[1:2] | [1:2][1:2]
[1:2] | [1:3][1:2]
[1:2][1:2] | [1:1][1:2]
- | [1:2][1:3]
[1:3] |
+ | [1:2][1:3]
(6 rows)
COPY domarrtest FROM stdin;
@@ -162,7 +162,7 @@ update domarrtest set
testint4arr[1] = testint4arr[1] + 1,
testint4arr[3] = testint4arr[3] - 1
where testchar4arr is null;
-select * from domarrtest where testchar4arr is null;
+select * from domarrtest where testchar4arr is null order by 1;
testint4arr | testchar4arr
------------------+--------------
{12,NULL,21} |
@@ -284,13 +284,14 @@ select * from dcomptable;
explain (verbose, costs off)
update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
where d1[1].i > 0;
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
- Update on public.dcomptable
- -> Seq Scan on public.dcomptable
- Output: (d1[1].r := (d1[1].r - '1'::double precision))[1].i := (d1[1].i + '1'::double precision), ctid
- Filter: (dcomptable.d1[1].i > '0'::double precision)
-(4 rows)
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------------
+ Remote Subquery Scan on any (datanode_1,datanode_2)
+ -> Update on public.dcomptable
+ -> Seq Scan on public.dcomptable
+ Output: (d1[1].r := (d1[1].r - '1'::double precision))[1].i := (d1[1].i + '1'::double precision), d1, ctid
+ Filter: (dcomptable.d1[1].i > '0'::double precision)
+(5 rows)
create rule silly as on delete to dcomptable do instead
update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
@@ -306,6 +307,8 @@ Rules:
silly AS
ON DELETE TO dcomptable DO INSTEAD UPDATE dcomptable SET d1[1].r = dcomptable.d1[1].r - 1::double precision, d1[1].i = dcomptable.d1[1].i + 1::double precision
WHERE dcomptable.d1[1].i > 0::double precision
+Distribute By: REPLICATION
+Location Nodes: ALL DATANODES
drop table dcomptable;
drop type comptype cascade;
diff --git a/src/test/regress/sql/domain.sql b/src/test/regress/sql/domain.sql
index 01d447c342..825655ff73 100644
--- a/src/test/regress/sql/domain.sql
+++ b/src/test/regress/sql/domain.sql
@@ -106,7 +106,7 @@ update domarrtest set
testint4arr[3] = testint4arr[3] - 1
where testchar4arr is null;
-select * from domarrtest where testchar4arr is null;
+select * from domarrtest where testchar4arr is null order by 1;
drop table domarrtest;
drop domain domainint4arr restrict;