Amend and accept regression diffs in 'insert' test case
authorPavan Deolasee <[email protected]>
Wed, 26 Sep 2018 08:22:16 +0000 (13:52 +0530)
committerPavan Deolasee <[email protected]>
Wed, 26 Sep 2018 08:22:16 +0000 (13:52 +0530)
We don't support triggers and hence the do-nothing trigger doesn't have the
desired effect in XL. As a result, the inserts are not skipped in XL (while
they are skipped because the before-row trigger returns nothing).  Also we
expect columns to be in the same order for partitions. So make those changes
too.

src/test/regress/expected/insert.out
src/test/regress/sql/insert.sql

index 34311897c9452eb2267da5d8e41a65a7b495976c..cb13e345f89204aad3cc9f143e8b6960294925b4 100644 (file)
@@ -587,25 +587,29 @@ drop function brtrigpartcon1trigf();
 -- check that "do nothing" BR triggers work with tuple-routing (this checks
 -- that estate->es_result_relation_info is appropriately set/reset for each
 -- routed tuple)
-create table donothingbrtrig_test (a int, b text) partition by list (a);
-create table donothingbrtrig_test1 (b text, a int);
-create table donothingbrtrig_test2 (c text, b text, a int);
+create table donothingbrtrig_test (a int, b text) partition by list (a) distributed by (a);
+create table donothingbrtrig_test1 (a int, b text) distributed by (a);
+create table donothingbrtrig_test2 (a int, b text, c text) distributed by (a);
 alter table donothingbrtrig_test2 drop column c;
 create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
 create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();
+ERROR:  Postgres-XL does not support TRIGGER yet
+DETAIL:  The feature is not currently supported
 create trigger donothingbrtrig2 before insert on donothingbrtrig_test2 for each row execute procedure donothingbrtrig_func();
+ERROR:  Postgres-XL does not support TRIGGER yet
+DETAIL:  The feature is not currently supported
 alter table donothingbrtrig_test attach partition donothingbrtrig_test1 for values in (1);
 alter table donothingbrtrig_test attach partition donothingbrtrig_test2 for values in (2);
 insert into donothingbrtrig_test values (1, 'foo'), (2, 'bar');
-NOTICE:  b: foo
-NOTICE:  b: bar
 copy donothingbrtrig_test from stdout;
-NOTICE:  b: baz
-NOTICE:  b: qux
 select tableoid::regclass, * from donothingbrtrig_test;
- tableoid | a | b 
-----------+---+---
-(0 rows)
+       tableoid        | a |  b  
+-----------------------+---+-----
+ donothingbrtrig_test1 | 1 | foo
+ donothingbrtrig_test1 | 1 | baz
+ donothingbrtrig_test2 | 2 | bar
+ donothingbrtrig_test2 | 2 | qux
+(4 rows)
 
 -- cleanup
 drop table donothingbrtrig_test;
index 82ac3e92996ab6d0fe574004fe1173cdd2726fae..55e0e843291f3b8d6bac4657b7f9a34425b4a107 100644 (file)
@@ -376,9 +376,9 @@ drop function brtrigpartcon1trigf();
 -- check that "do nothing" BR triggers work with tuple-routing (this checks
 -- that estate->es_result_relation_info is appropriately set/reset for each
 -- routed tuple)
-create table donothingbrtrig_test (a int, b text) partition by list (a);
-create table donothingbrtrig_test1 (b text, a int);
-create table donothingbrtrig_test2 (c text, b text, a int);
+create table donothingbrtrig_test (a int, b text) partition by list (a) distributed by (a);
+create table donothingbrtrig_test1 (a int, b text) distributed by (a);
+create table donothingbrtrig_test2 (a int, b text, c text) distributed by (a);
 alter table donothingbrtrig_test2 drop column c;
 create or replace function donothingbrtrig_func() returns trigger as $$begin raise notice 'b: %', new.b; return NULL; end$$ language plpgsql;
 create trigger donothingbrtrig1 before insert on donothingbrtrig_test1 for each row execute procedure donothingbrtrig_func();