diff options
| author | Michael Paquier | 2012-04-24 10:48:41 +0000 |
|---|---|---|
| committer | Michael Paquier | 2012-04-24 10:48:41 +0000 |
| commit | ba13c73845855573c28d16fc4a4d5919b3e0946c (patch) | |
| tree | 99a1f1f4506861bf79609f5e737207729dd8a0a2 /src/test | |
| parent | f12afa86e544f581c7c6d7a0fdf02502c4a0aed9 (diff) | |
Fix standard remote DML plans using inherited tables
Simple test cases like this one were not possible for 4 reasons:
create table p1 (f1 int);
create table c1 (f2 text, f3 int) inherits (p1);
alter table p1 add column a1 int check (a1 > 0);
alter table p1 add column f2 text;
insert into p1 values (1,2,'abc');
insert into c1 values(11,'xyz',33,22);
update p1 set a1 = a1 + 1, f2 = upper(f2);
1) When generating a remote DDL query, the parent relation name was
used instead of the child name.
2) UPDATE and DELETE did not use ONLY when generating query, causing
subtables to be deleted or updated twice. Well deletion is not so much
a problem but UPDATE leaded to inconsistencies for stuff updated like
"column = column + expression()"
3) Remote DDL executor was always using the parent plan, leading to
inconsistencies in parameters pushed down
4) In query generated for remote UPDATE, the attribute number used was the
one from target list. In case of parent it is correct, but not always for
child tables.
This commit fixes some issues in tests alter_table and plpgsql.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/xc_FQS_join.out | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/regress/expected/xc_FQS_join.out b/src/test/regress/expected/xc_FQS_join.out index aa496cc9a0..c4af46e7ae 100644 --- a/src/test/regress/expected/xc_FQS_join.out +++ b/src/test/regress/expected/xc_FQS_join.out @@ -484,7 +484,7 @@ explain (costs off, verbose on, nodes off) update tab1_mod set val2 = 1000 from -------------------------------------------------------------------------------------------------------------------- Update on public.tab1_mod Node expr: tab1_mod.val - Remote query: UPDATE public.tab1_mod SET val2 = $2 WHERE ctid = $5 AND xc_node_id = $6 + Remote query: UPDATE ONLY public.tab1_mod SET val2 = $2 WHERE ctid = $5 AND xc_node_id = $6 -> Nested Loop Output: tab1_mod.val, 1000, tab1_mod.val, tab1_mod.val2, tab1_mod.ctid, tab1_mod.xc_node_id, tab2_mod.ctid Join Filter: ((tab1_mod.val = tab2_mod.val) AND (tab1_mod.val2 = tab2_mod.val2)) @@ -501,7 +501,7 @@ explain (costs off, verbose on, nodes off) delete from tab1_mod using tab2_mod QUERY PLAN ------------------------------------------------------------------------------------------------ Delete on public.tab1_mod - Remote query: DELETE FROM public.tab1_mod WHERE ctid = $3 AND xc_node_id = $4 + Remote query: DELETE FROM ONLY public.tab1_mod WHERE ctid = $3 AND xc_node_id = $4 -> Nested Loop Output: tab1_mod.val, tab1_mod.val2, tab1_mod.ctid, tab1_mod.xc_node_id, tab2_mod.ctid Join Filter: ((tab1_mod.val = tab2_mod.val) AND (tab1_mod.val2 = tab2_mod.val2)) @@ -518,7 +518,7 @@ explain (costs off, verbose on, nodes off) update tab1_rep set val2 = 1000 from QUERY PLAN ----------------------------------------------------------------------------------------------- Update on public.tab1_rep - Remote query: UPDATE public.tab1_rep SET val2 = $2 WHERE ctid = $5 + Remote query: UPDATE ONLY public.tab1_rep SET val2 = $2 WHERE ctid = $5 -> Nested Loop Output: tab1_rep.val, 1000, tab1_rep.val, tab1_rep.val2, tab1_rep.ctid, tab2_rep.ctid Join Filter: ((tab1_rep.val = tab2_rep.val) AND (tab1_rep.val2 = tab2_rep.val2)) @@ -535,7 +535,7 @@ explain (costs off, verbose on, nodes off) delete from tab1_rep using tab2_rep QUERY PLAN ------------------------------------------------------------------------------------------ Delete on public.tab1_rep - Remote query: DELETE FROM public.tab1_rep WHERE ctid = $3 + Remote query: DELETE FROM ONLY public.tab1_rep WHERE ctid = $3 -> Nested Loop Output: tab1_rep.val, tab1_rep.val2, tab1_rep.ctid, tab2_rep.ctid Join Filter: ((tab1_rep.val = tab2_rep.val) AND (tab1_rep.val2 = tab2_rep.val2)) |
