| 1 |
-- source include/have_ndb.inc |
| 2 |
|
| 3 |
# WL#6057 make semijoin work with single-table UPDATE/DELETE |
| 4 |
# Verify that NDB isn't affected (this is to preserve |
| 5 |
# the possibility to use read-before-write removal) |
| 6 |
|
| 7 |
create table t1(a int) engine=ndbcluster; |
| 8 |
create table t2(a int) engine=ndbcluster; |
| 9 |
insert into t1 values(10),(11),(12),(13),(14),(15),(16); |
| 10 |
insert into t2 values(100),(11),(120); |
| 11 |
analyze table t1,t2; |
| 12 |
|
| 13 |
# Does not become multi-table even though there is IN(subquery): |
| 14 |
|
| 15 |
explain format=tree update t1 set t1.a=3 where a=(select a from t2); |
| 16 |
explain update t1 set t1.a=3 where a in (select a from t2); |
| 17 |
update t1 set t1.a=3 where a in (select a from t2); |
| 18 |
--sorted_result |
| 19 |
select * from t1; |
| 20 |
|
| 21 |
# restore the data for next test |
| 22 |
delete from t1; |
| 23 |
insert into t1 values(10),(11),(12),(13),(14),(15),(16); |
| 24 |
analyze table t1; |
| 25 |
|
| 26 |
explain format=tree delete from t1 where a=(select a from t2); |
| 27 |
explain delete from t1 where a in (select a from t2); |
| 28 |
delete from t1 where a in (select a from t2); |
| 29 |
--sorted_result |
| 30 |
select * from t1; |
| 31 |
|
| 32 |
drop table t1,t2; |