summaryrefslogtreecommitdiff
path: root/mysql-test/r/table_elim.result
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-11-27 17:43:16 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-11-27 17:43:16 +0400
commit928543ca6c3f37fb1f401d5fc41c71e597e76927 (patch)
tree57a7c43805378632443e3b1e2318978f571542fb /mysql-test/r/table_elim.result
parent998ed51497ae46b2478d490e22cccd16295701f8 (diff)
downloadmariadb-git-928543ca6c3f37fb1f401d5fc41c71e597e76927.tar.gz
MDEV-5344: LEFT OUTER JOIN table data is lost in ON DUPLICATE KEY UPDATE section
- For INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, table elimination should check which tables are referenced in the ON DUPLICATE KEY UPDATE clause.
Diffstat (limited to 'mysql-test/r/table_elim.result')
-rw-r--r--mysql-test/r/table_elim.result28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index 35acd30d76d..1ac46a21cce 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -609,4 +609,32 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using index
drop view v1;
DROP TABLE t1,t2,t3;
+#
+# MDEV-5344: LEFT OUTER JOIN table data is lost in ON DUPLICATE KEY UPDATE section
+#
+create table t1 (
+id int(10) unsigned NOT NULL DEFAULT '0',
+v int(10) unsigned DEFAULT '0',
+PRIMARY KEY (id)
+);
+create table t2 (
+id int(10) unsigned NOT NULL DEFAULT '0',
+PRIMARY KEY (id)
+) ;
+create table t3 (
+id int(10) unsigned NOT NULL DEFAULT '0',
+v int(10) unsigned DEFAULT '0',
+PRIMARY KEY (id)
+);
+insert into t1 values (1, 10), (2, 10);
+insert into t2 values (1), (2);
+insert into t3 values (1, 20);
+insert into t1
+select t2.id, 5 from t2 LEFT OUTER JOIN t3 ON t2.id = t3.id
+on duplicate key update t1.v = t3.v;
+select * from t1;
+id v
+1 20
+2 NULL
+drop table t1,t2,t3;
SET optimizer_switch=@save_optimizer_switch;