gpdb
gpdb copied to clipboard
SplitUpdate set wrong target list reference
Bug Report
Greenplum version or build
6X (top commit 0eb8cd4a74adf0b10ceac334036f90bfeaa92faa), regerssion problem, regression commit is ebc448703a0b186fa25177fb48a7e5c5463270d7.
Step to reproduce the behavior
gpadmin@zlyu-rr:~/workspace/gpdb$ psql
psql (9.4.26)
Type "help" for help.
gpadmin=# drop table if exists test_update;
create table test_update(
"a" varchar,
"b" varchar,
"c" varchar
) distributed by (b);
insert into test_update(a, b, c) values('3', '3', '2');
insert into test_update(a, b, c) values('3', '3', '2');
explain
UPDATE test_update
SET a = '3',
b = '3',
c = '2'
WHERE b = '3';
DROP TABLE
CREATE TABLE
INSERT 0 1
INSERT 0 1
QUERY PLAN
-----------------------------------------------------------------------------------------
Update on test_update (cost=0.00..1.03 rows=1 width=12)
-> Redistribute Motion 1:2 (slice1; segments: 1) (cost=0.00..1.03 rows=2 width=12)
Hash Key: a
-> Split (cost=0.00..1.03 rows=1 width=12)
-> Seq Scan on test_update (cost=0.00..1.01 rows=1 width=12)
Filter: ((b)::text = '3'::text)
Optimizer: Postgres query optimizer
(7 rows)
gpadmin=# UPDATE test_update
SET a = '3',
b = '3',
c = '2'
WHERE b = '3';
ERROR: distribution key of the tuple (0, 1) doesn't belong to current segment (actually from seg1) (nodeModifyTable.c:716) (seg0 127.0.1.1:6002 pid=213847) (nodeModifyTable.c:716)