summaryrefslogtreecommitdiff
path: root/mysql-test/r/table_elim.result
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2009-08-24 10:12:42 +0200
committerSergey Petrunya <psergey@askmonty.org>2009-08-24 10:12:42 +0200
commit21d25739088a125804db1c084b91078e8ea1c5b0 (patch)
tree199f13818211e879cf90d4137a6a38dbd9d69df8 /mysql-test/r/table_elim.result
parentf3d0b1c04e0d7edf21e1ae1378b2bafe9580f147 (diff)
downloadmariadb-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/r/table_elim.result')
-rw-r--r--mysql-test/r/table_elim.result29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index 5aad6ea45bd..8ce03b06cab 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -278,3 +278,32 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 10 NULL 2 Using index
1 SIMPLE t2 ref a a 3 test.t1.a 2
drop table t1, t2;
+#
+# check UPDATE/DELETE that look like they could be eliminated
+#
+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;
+a b
+1 1
+2 2
+3 3
+select * from t2;
+a b
+101 1
+102 2
+103 3
+delete from t2;
+insert into t2 select * from t1;
+delete t2 from t1 left join t2 using (a);
+select * from t1;
+a b
+1 1
+2 2
+3 3
+select * from t2;
+a b
+drop table t1, t2;