-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Hang is observed in 2.1.210, but not 2.0.206.
In the following script, the first execution of the merge returns 1 row. The second execution hangs.
drop table if exists test;
create table test (id int primary key, val1 int, val2 int);
insert into test (id, val1, val2) values (1, 2, 3);
insert into test (id, val1, val2) values (2, 2, 3);
insert into test (id, val1, val2) values (3, 2, 3);
commit;
select test.id from final table (
merge into test using (
select t.id, t.val1, t.val2 from (select 1, 2, 3) t (id, val1, val2)) t on test.id = t.id when matched and test.id = 1 then update set test.id = 1, test.val1 = 2, test.val2 = 3 when not matched then insert(id, val1, val2) values (t.id, t.val1, t.val2)) test;
select test.id from final table (
merge into test using (
select t.id, t.val1, t.val2 from (select 1, 2, 3) t (id, val1, val2)) t on test.id = t.id when matched and test.id = 1 then update set test.id = 1, test.val1 = 2, test.val2 = 3 when not matched then insert(id, val1, val2) values (t.id, t.val1, t.val2)) test;
Metadata
Metadata
Assignees
Labels
No labels