提交 fd054152 编写于 作者: H Heikki Linnakangas

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.
上级 05346eb2
-- 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;
-- 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;
......@@ -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
......
-- 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;
-- @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)
-- @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)
-- @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)
-- @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)
-- @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)
-- @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)
-- @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)
-- @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)
-- @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)
-- @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)
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
-- @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;
--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;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册