diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2009-08-24 10:12:42 +0200 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2009-08-24 10:12:42 +0200 |
commit | 21d25739088a125804db1c084b91078e8ea1c5b0 (patch) | |
tree | 199f13818211e879cf90d4137a6a38dbd9d69df8 /mysql-test/t/table_elim.test | |
parent | f3d0b1c04e0d7edf21e1ae1378b2bafe9580f147 (diff) | |
download | mariadb-git-21d25739088a125804db1c084b91078e8ea1c5b0.tar.gz |
MWL#17: Table elimination
- Correctly handle the case where we have multi-table DELETE and a table
that we're deleting from looks like it could be eliminated.
Diffstat (limited to 'mysql-test/t/table_elim.test')
-rw-r--r-- | mysql-test/t/table_elim.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test index f4ea009f09a..cc4a179d825 100644 --- a/mysql-test/t/table_elim.test +++ b/mysql-test/t/table_elim.test @@ -229,3 +229,23 @@ explain select t1.* from t1 left join t2 on t2.a=t1.a; drop table t1, t2; +--echo # +--echo # check UPDATE/DELETE that look like they could be eliminated +--echo # +create table t1 (a int primary key, b int); +insert into t1 values (1,1),(2,2),(3,3); + +create table t2 like t1; +insert into t2 select * from t1; +update t1 left join t2 using (a) set t2.a=t2.a+100; +select * from t1; +select * from t2; + +delete from t2; +insert into t2 select * from t1; + +delete t2 from t1 left join t2 using (a); +select * from t1; +select * from t2; +drop table t1, t2; + |