From fd05415259a85fcca9ccd3784321ab5b4ebd24ae Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 19 Oct 2017 12:19:54 +0300 Subject: [PATCH] Move tests for MPP-21536 out of TINC, to a new 'bfv_dml' test. I'm not entirely sure what the bug was that these test, or whether we have coverage for it already, but the tests are cheap enough that I don't mind just adding them. --- src/test/regress/expected/bfv_dml.out | 180 ++++++++++++++++++ .../regress/expected/bfv_dml_optimizer.out | 180 ++++++++++++++++++ src/test/regress/greenplum_schedule | 2 +- src/test/regress/sql/bfv_dml.sql | 102 ++++++++++ .../expected/mpp21536_delete_hash_1.ans | 18 -- .../expected/mpp21536_delete_hash_2.ans | 20 -- .../expected/mpp21536_delete_random_1.ans | 18 -- .../expected/mpp21536_delete_random_2.ans | 20 -- .../expected/mpp21536_insert_hash.ans | 28 --- .../expected/mpp21536_insert_random.ans | 28 --- .../expected/mpp21536_update_hash_1.ans | 29 --- .../expected/mpp21536_update_hash_2.ans | 28 --- .../expected/mpp21536_update_random_1.ans | 28 --- .../expected/mpp21536_update_random_2.ans | 28 --- .../functional/sql/mpp21536_delete_hash_1.sql | 13 -- .../sql/mpp21536_delete_hash_1_setup.sql | 22 --- .../functional/sql/mpp21536_delete_hash_2.sql | 13 -- .../sql/mpp21536_delete_hash_2_setup.sql | 22 --- .../sql/mpp21536_delete_random_1.sql | 13 -- .../sql/mpp21536_delete_random_1_setup.sql | 19 -- .../sql/mpp21536_delete_random_2.sql | 13 -- .../sql/mpp21536_delete_random_2_setup.sql | 19 -- .../functional/sql/mpp21536_insert_hash.sql | 13 -- .../sql/mpp21536_insert_hash_setup.sql | 19 -- .../functional/sql/mpp21536_insert_random.sql | 13 -- .../sql/mpp21536_insert_random_setup.sql | 16 -- .../functional/sql/mpp21536_update_hash_1.sql | 14 -- .../sql/mpp21536_update_hash_1_setup.sql | 22 --- .../functional/sql/mpp21536_update_hash_2.sql | 13 -- .../sql/mpp21536_update_hash_2_setup.sql | 22 --- .../sql/mpp21536_update_random_1.sql | 13 -- .../sql/mpp21536_update_random_1_setup.sql | 19 -- .../sql/mpp21536_update_random_2.sql | 13 -- .../sql/mpp21536_update_random_2_setup.sql | 19 -- 34 files changed, 463 insertions(+), 576 deletions(-) create mode 100644 src/test/regress/expected/bfv_dml.out create mode 100644 src/test/regress/expected/bfv_dml_optimizer.out create mode 100644 src/test/regress/sql/bfv_dml.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_1.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_2.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_1.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_2.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_hash.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_random.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_1.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_2.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_1.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_2.ans delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1_setup.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2.sql delete mode 100644 src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2_setup.sql diff --git a/src/test/regress/expected/bfv_dml.out b/src/test/regress/expected/bfv_dml.out new file mode 100644 index 0000000000..cec7c46e1a --- /dev/null +++ b/src/test/regress/expected/bfv_dml.out @@ -0,0 +1,180 @@ +-- MPP-21536: Duplicated rows inserted when ORCA is turned on +-- create test table +create table m(); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause, and no column type is suitable for a distribution key. Creating a NULL policy entry. +alter table m add column a int; +alter table m add column b int; +-- generate data for m +insert into m select i, i%5 from generate_series(1,10)i; +-- INSERT and UPDATE +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +select * from yyy order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +update yyy set a=m.b from m where m.a=yyy.b; +select * from yyy order by 1, 2; + a | b +----+--- + 1 | 1 + 1 | 1 + 2 | 2 + 2 | 2 + 3 | 3 + 3 | 3 + 4 | 4 + 4 | 4 + 5 | 0 + 10 | 0 +(10 rows) + +drop table yyy; +-- UPDATE with different values +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +update yyy set b=m.b from m where m.a=yyy.a; +select * from yyy order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +drop table yyy; +-- DELETE +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +delete from yyy where a in (select a from m); +select * from yyy order by 1, 2; + a | b +---+--- +(0 rows) + +drop table yyy; +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +delete from yyy where b in (select a from m); +select * from yyy order by 1, 2; + a | b +----+--- + 5 | 0 + 10 | 0 +(2 rows) + +drop table yyy; +-- Now repeat all the above tests, but using a hacked master-only 'm' table +drop table m; +set optimizer_enable_master_only_queries=on; +-- create master-only table +create table m(); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause, and no column type is suitable for a distribution key. Creating a NULL policy entry. +set allow_system_table_mods='DML'; +delete from gp_distribution_policy where localoid='m'::regclass; +reset allow_system_table_mods; +alter table m add column a int; +alter table m add column b int; +-- generate data for m +insert into m select i, i%5 from generate_series(1,10)i; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +select * from zzz order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +delete from zzz where a in (select a from m); +select * from zzz order by 1, 2; + a | b +---+--- +(0 rows) + +drop table zzz; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +delete from zzz where b in (select a from m); +select * from zzz order by 1, 2; + a | b +----+--- + 5 | 0 + 10 | 0 +(2 rows) + +drop table zzz; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +-- This update fails with duplicate key error, but it varies which segment +-- reports it first, i.e. it varies which row it complaints first. Silence +-- that difference in the error DETAIL line +\set VERBOSITY terse +update zzz set a=m.b from m where m.a=zzz.b; +ERROR: Cannot parallelize an UPDATE statement that updates the distribution columns +select * from zzz order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +drop table zzz; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +update zzz set b=m.b from m where m.a=zzz.a; +select * from zzz order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +drop table zzz; +drop table m; diff --git a/src/test/regress/expected/bfv_dml_optimizer.out b/src/test/regress/expected/bfv_dml_optimizer.out new file mode 100644 index 0000000000..3c5ce1c4b6 --- /dev/null +++ b/src/test/regress/expected/bfv_dml_optimizer.out @@ -0,0 +1,180 @@ +-- MPP-21536: Duplicated rows inserted when ORCA is turned on +-- create test table +create table m(); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause, and no column type is suitable for a distribution key. Creating a NULL policy entry. +alter table m add column a int; +alter table m add column b int; +-- generate data for m +insert into m select i, i%5 from generate_series(1,10)i; +-- INSERT and UPDATE +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +select * from yyy order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +update yyy set a=m.b from m where m.a=yyy.b; +select * from yyy order by 1, 2; + a | b +----+--- + 1 | 1 + 1 | 1 + 2 | 2 + 2 | 2 + 3 | 3 + 3 | 3 + 4 | 4 + 4 | 4 + 5 | 0 + 10 | 0 +(10 rows) + +drop table yyy; +-- UPDATE with different values +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +update yyy set b=m.b from m where m.a=yyy.a; +select * from yyy order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +drop table yyy; +-- DELETE +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +delete from yyy where a in (select a from m); +select * from yyy order by 1, 2; + a | b +---+--- +(0 rows) + +drop table yyy; +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +delete from yyy where b in (select a from m); +select * from yyy order by 1, 2; + a | b +----+--- + 5 | 0 + 10 | 0 +(2 rows) + +drop table yyy; +-- Now repeat all the above tests, but using a hacked master-only 'm' table +drop table m; +set optimizer_enable_master_only_queries=on; +-- create master-only table +create table m(); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause, and no column type is suitable for a distribution key. Creating a NULL policy entry. +set allow_system_table_mods='DML'; +delete from gp_distribution_policy where localoid='m'::regclass; +reset allow_system_table_mods; +alter table m add column a int; +alter table m add column b int; +-- generate data for m +insert into m select i, i%5 from generate_series(1,10)i; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +select * from zzz order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +delete from zzz where a in (select a from m); +select * from zzz order by 1, 2; + a | b +---+--- +(0 rows) + +drop table zzz; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +delete from zzz where b in (select a from m); +select * from zzz order by 1, 2; + a | b +----+--- + 5 | 0 + 10 | 0 +(2 rows) + +drop table zzz; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +-- This update fails with duplicate key error, but it varies which segment +-- reports it first, i.e. it varies which row it complaints first. Silence +-- that difference in the error DETAIL line +\set VERBOSITY terse +update zzz set a=m.b from m where m.a=zzz.b; +ERROR: duplicate key value violates unique constraint "zzz_pkey" (seg1 127.0.0.1:40001 pid=22395) +select * from zzz order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +drop table zzz; +create table zzz(a int primary key, b int) distributed by (a); +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "zzz_pkey" for table "zzz" +insert into zzz select a,b from m; +update zzz set b=m.b from m where m.a=zzz.a; +select * from zzz order by 1, 2; + a | b +----+--- + 1 | 1 + 2 | 2 + 3 | 3 + 4 | 4 + 5 | 0 + 6 | 1 + 7 | 2 + 8 | 3 + 9 | 4 + 10 | 0 +(10 rows) + +drop table zzz; +drop table m; diff --git a/src/test/regress/greenplum_schedule b/src/test/regress/greenplum_schedule index 4dfcd33a09..ba2ca0fd88 100755 --- a/src/test/regress/greenplum_schedule +++ b/src/test/regress/greenplum_schedule @@ -110,7 +110,7 @@ test: tuple_serialization # NOTE: The bfv_temp test assumes that there are no temporary tables in # other sessions. Therefore the other tests in this group mustn't create # temp tables -test: bfv_cte bfv_joins bfv_subquery bfv_planner bfv_legacy bfv_temp +test: bfv_cte bfv_joins bfv_subquery bfv_planner bfv_legacy bfv_temp bfv_dml test: qp_olap_mdqa qp_misc gp_recursive_cte diff --git a/src/test/regress/sql/bfv_dml.sql b/src/test/regress/sql/bfv_dml.sql new file mode 100644 index 0000000000..2652087fbc --- /dev/null +++ b/src/test/regress/sql/bfv_dml.sql @@ -0,0 +1,102 @@ +-- MPP-21536: Duplicated rows inserted when ORCA is turned on + +-- create test table +create table m(); +alter table m add column a int; +alter table m add column b int; + +-- generate data for m +insert into m select i, i%5 from generate_series(1,10)i; + +-- INSERT and UPDATE +create table yyy(a int, b int) distributed randomly; + +insert into yyy select a,b from m; +select * from yyy order by 1, 2; + +update yyy set a=m.b from m where m.a=yyy.b; +select * from yyy order by 1, 2; + +drop table yyy; + + +-- UPDATE with different values +create table yyy(a int, b int) distributed randomly; + +insert into yyy select a,b from m; +update yyy set b=m.b from m where m.a=yyy.a; +select * from yyy order by 1, 2; + +drop table yyy; + + +-- DELETE +create table yyy(a int, b int) distributed randomly; + +insert into yyy select a,b from m; +delete from yyy where a in (select a from m); +select * from yyy order by 1, 2; + +drop table yyy; + +create table yyy(a int, b int) distributed randomly; +insert into yyy select a,b from m; +delete from yyy where b in (select a from m); +select * from yyy order by 1, 2; + +drop table yyy; + + +-- Now repeat all the above tests, but using a hacked master-only 'm' table +drop table m; + +set optimizer_enable_master_only_queries=on; + + +-- create master-only table +create table m(); +set allow_system_table_mods='DML'; +delete from gp_distribution_policy where localoid='m'::regclass; +reset allow_system_table_mods; +alter table m add column a int; +alter table m add column b int; + +-- generate data for m +insert into m select i, i%5 from generate_series(1,10)i; + +create table zzz(a int primary key, b int) distributed by (a); +insert into zzz select a,b from m; +select * from zzz order by 1, 2; + +delete from zzz where a in (select a from m); +select * from zzz order by 1, 2; + +drop table zzz; + +create table zzz(a int primary key, b int) distributed by (a); + +insert into zzz select a,b from m; +delete from zzz where b in (select a from m); +select * from zzz order by 1, 2; + +drop table zzz; + +create table zzz(a int primary key, b int) distributed by (a); +insert into zzz select a,b from m; + +-- This update fails with duplicate key error, but it varies which segment +-- reports it first, i.e. it varies which row it complaints first. Silence +-- that difference in the error DETAIL line +\set VERBOSITY terse +update zzz set a=m.b from m where m.a=zzz.b; +select * from zzz order by 1, 2; + +drop table zzz; + +create table zzz(a int primary key, b int) distributed by (a); +insert into zzz select a,b from m; +update zzz set b=m.b from m where m.a=zzz.a; +select * from zzz order by 1, 2; + +drop table zzz; +drop table m; diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_1.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_1.ans deleted file mode 100644 index fda109f71c..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_1.ans +++ /dev/null @@ -1,18 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -delete from zzz where a in (select a from m); -DELETE 10 -select * from zzz order by 1, 2; - a | b ----+--- -(0 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_2.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_2.ans deleted file mode 100644 index b426a2f07e..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_hash_2.ans +++ /dev/null @@ -1,20 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -delete from zzz where b in (select a from m); -DELETE 8 -select * from zzz order by 1, 2; - a | b -----+--- - 5 | 0 - 10 | 0 -(2 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_1.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_1.ans deleted file mode 100644 index 270a6181d5..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_1.ans +++ /dev/null @@ -1,18 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -delete from yyy where a in (select a from m); -DELETE 10 -select * from yyy order by 1, 2; - a | b ----+--- -(0 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_2.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_2.ans deleted file mode 100644 index bf58875351..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_delete_random_2.ans +++ /dev/null @@ -1,20 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -delete from yyy where b in (select a from m); -DELETE 8 -select * from yyy order by 1, 2; - a | b -----+--- - 5 | 0 - 10 | 0 -(2 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_hash.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_hash.ans deleted file mode 100644 index e56bab6b9e..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_hash.ans +++ /dev/null @@ -1,28 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -insert into zzz select a,b from m; -INSERT 0 10 -select * from zzz order by 1, 2; - a | b -----+--- - 1 | 1 - 2 | 2 - 3 | 3 - 4 | 4 - 5 | 0 - 6 | 1 - 7 | 2 - 8 | 3 - 9 | 4 - 10 | 0 -(10 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_random.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_random.ans deleted file mode 100644 index e747cb3c01..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_insert_random.ans +++ /dev/null @@ -1,28 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -insert into yyy select a,b from m; -INSERT 0 10 -select * from yyy order by 1, 2; - a | b -----+--- - 1 | 1 - 2 | 2 - 3 | 3 - 4 | 4 - 5 | 0 - 6 | 1 - 7 | 2 - 8 | 3 - 9 | 4 - 10 | 0 -(10 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_1.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_1.ans deleted file mode 100644 index cc7bc784ad..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_1.ans +++ /dev/null @@ -1,29 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -update zzz set a=m.b from m where m.a=zzz.b; -ERROR: duplicate key value violates unique constraint "zzz_pkey" -DETAIL: Key (a)=(3) already exists. -select * from zzz order by 1, 2; - a | b -----+--- - 1 | 1 - 2 | 2 - 3 | 3 - 4 | 4 - 5 | 0 - 6 | 1 - 7 | 2 - 8 | 3 - 9 | 4 - 10 | 0 -(10 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_2.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_2.ans deleted file mode 100644 index 7651233258..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_hash_2.ans +++ /dev/null @@ -1,28 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -update zzz set b=m.b from m where m.a=zzz.a; -UPDATE 10 -select * from zzz order by 1, 2; - a | b -----+--- - 1 | 1 - 2 | 2 - 3 | 3 - 4 | 4 - 5 | 0 - 6 | 1 - 7 | 2 - 8 | 3 - 9 | 4 - 10 | 0 -(10 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_1.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_1.ans deleted file mode 100644 index 65a4eed02d..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_1.ans +++ /dev/null @@ -1,28 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -update yyy set a=m.b from m where m.a=yyy.b; -UPDATE 8 -select * from yyy order by 1, 2; - a | b -----+--- - 1 | 1 - 1 | 1 - 2 | 2 - 2 | 2 - 3 | 3 - 3 | 3 - 4 | 4 - 4 | 4 - 5 | 0 - 10 | 0 -(10 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_2.ans b/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_2.ans deleted file mode 100644 index 6d7ea8cb0f..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/expected/mpp21536_update_random_2.ans +++ /dev/null @@ -1,28 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on --- start_ignore -SET optimizer_log=on;SET optimizer=on; -SET -SET --- end_ignore -update yyy set b=m.b from m where m.a=yyy.a; -UPDATE 10 -select * from yyy order by 1, 2; - a | b -----+--- - 1 | 1 - 2 | 2 - 3 | 3 - 4 | 4 - 5 | 0 - 6 | 1 - 7 | 2 - 8 | 3 - 9 | 4 - 10 | 0 -(10 rows) - diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1.sql deleted file mode 100644 index 561d801e93..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -delete from zzz where a in (select a from m); - -select * from zzz order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1_setup.sql deleted file mode 100644 index cce03b4abe..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_1_setup.sql +++ /dev/null @@ -1,22 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists zzz; ---end_ignore - -create table zzz(a int primary key, b int) distributed by (a); - --- create master-only table -create table m(); -set allow_system_table_mods='DML'; -delete from gp_distribution_policy where localoid='m'::regclass; -reset allow_system_table_mods; -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into zzz select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2.sql deleted file mode 100644 index 7a45062ca1..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -delete from zzz where b in (select a from m); - -select * from zzz order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2_setup.sql deleted file mode 100644 index cce03b4abe..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_hash_2_setup.sql +++ /dev/null @@ -1,22 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists zzz; ---end_ignore - -create table zzz(a int primary key, b int) distributed by (a); - --- create master-only table -create table m(); -set allow_system_table_mods='DML'; -delete from gp_distribution_policy where localoid='m'::regclass; -reset allow_system_table_mods; -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into zzz select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1.sql deleted file mode 100644 index b99e5318e6..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -delete from yyy where a in (select a from m); - -select * from yyy order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1_setup.sql deleted file mode 100644 index fbde2c1ef3..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_1_setup.sql +++ /dev/null @@ -1,19 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists yyy; ---end_ignore - -create table yyy(a int, b int) distributed randomly; - --- create master-only table -create table m(); -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into yyy select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2.sql deleted file mode 100644 index b88c8108d5..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -delete from yyy where b in (select a from m); - -select * from yyy order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2_setup.sql deleted file mode 100644 index fbde2c1ef3..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_delete_random_2_setup.sql +++ /dev/null @@ -1,19 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists yyy; ---end_ignore - -create table yyy(a int, b int) distributed randomly; - --- create master-only table -create table m(); -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into yyy select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash.sql deleted file mode 100644 index ecb572c5d9..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -insert into zzz select a,b from m; - -select * from zzz order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash_setup.sql deleted file mode 100644 index c9394e86cc..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_hash_setup.sql +++ /dev/null @@ -1,19 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists zzz; ---end_ignore - -create table zzz(a int primary key, b int) distributed by (a); --- create master-only table -create table m(); -set allow_system_table_mods='DML'; -delete from gp_distribution_policy where localoid='m'::regclass; -reset allow_system_table_mods; -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random.sql deleted file mode 100644 index 3a17e73867..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -insert into yyy select a,b from m; - -select * from yyy order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random_setup.sql deleted file mode 100644 index c597038c17..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_insert_random_setup.sql +++ /dev/null @@ -1,16 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists yyy; ---end_ignore - -create table yyy(a int, b int) distributed randomly; --- create master-only table -create table m(); -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1.sql deleted file mode 100644 index c5c445e7e7..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1.sql +++ /dev/null @@ -1,14 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -set optimizer_enable_master_only_queries=on; -\echo --end_ignore - -update zzz set a=m.b from m where m.a=zzz.b; - -select * from zzz order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1_setup.sql deleted file mode 100644 index a64a19d04b..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_1_setup.sql +++ /dev/null @@ -1,22 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists zzz; ---end_ignore - -create table zzz(a int primary key, b int) distributed by (a); - --- create master-only table -create table m(); -set allow_system_table_mods='DML'; -delete from gp_distribution_policy where localoid='m'::regclass; -reset allow_system_table_mods; -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into zzz select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2.sql deleted file mode 100644 index 19c9ea0a61..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -update zzz set b=m.b from m where m.a=zzz.a; - -select * from zzz order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2_setup.sql deleted file mode 100644 index a64a19d04b..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_hash_2_setup.sql +++ /dev/null @@ -1,22 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists zzz; ---end_ignore - -create table zzz(a int primary key, b int) distributed by (a); - --- create master-only table -create table m(); -set allow_system_table_mods='DML'; -delete from gp_distribution_policy where localoid='m'::regclass; -reset allow_system_table_mods; -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into zzz select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1.sql deleted file mode 100644 index 4e953a82d7..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -update yyy set a=m.b from m where m.a=yyy.b; - -select * from yyy order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1_setup.sql deleted file mode 100644 index fbde2c1ef3..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_1_setup.sql +++ /dev/null @@ -1,19 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists yyy; ---end_ignore - -create table yyy(a int, b int) distributed randomly; - --- create master-only table -create table m(); -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into yyy select a,b from m; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2.sql deleted file mode 100644 index d42ecb26b3..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2.sql +++ /dev/null @@ -1,13 +0,0 @@ --- @author ramans2 --- @created 2013-10-30 12:00:00 --- @modified 2013-10-30 12:00:00 --- @tags dml --- @db_name dmldb --- @description MPP-21536: Duplicated rows inserted when ORCA is turned on -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore - -update yyy set b=m.b from m where m.a=yyy.a; - -select * from yyy order by 1, 2; diff --git a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2_setup.sql b/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2_setup.sql deleted file mode 100644 index fbde2c1ef3..0000000000 --- a/src/test/tinc/tincrepo/dml/functional/sql/mpp21536_update_random_2_setup.sql +++ /dev/null @@ -1,19 +0,0 @@ ---start_ignore -\echo --start_ignore -set gp_enable_column_oriented_table=on; -\echo --end_ignore -drop table if exists m; -drop table if exists yyy; ---end_ignore - -create table yyy(a int, b int) distributed randomly; - --- create master-only table -create table m(); -alter table m add column a int; -alter table m add column b int; - --- generate data for m -insert into m select i, i%5 from generate_series(1,10)i; - -insert into yyy select a,b from m; -- GitLab