summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2014-05-01 17:19:17 +0300
committerunknown <sanja@askmonty.org>2014-05-01 17:19:17 +0300
commit285160dee270abbbfef9b7c1fb72ec4040c42262 (patch)
treec55beb66ac77398cb722da3e07fcfa7bf919f395 /mysql-test/t/view.test
parenta24ea50d1a04d7bfe9608fe1ea8ac1ab8ed97294 (diff)
downloadmariadb-git-285160dee270abbbfef9b7c1fb72ec4040c42262.tar.gz
MDEV-5981: name resolution issues with views and multi-update in ps-protocol
It is triple bug with one test suite: 1. Incorrect outer table detection 2. Incorrect leaf table processing for multi-update (should be full like for usual updates and inserts) 3. ON condition fix_fields() fould be called for all tables of the query.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 5a2d90180ea..b91e2f4bd24 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -4739,6 +4739,25 @@ select * from v1;
drop view v1;
drop table t1;
+--echo #
+--echo # MDEV-5981: name resolution issues with views and multi-update
+--echo # in ps-protocol
+--echo #
+
+create table t1 (id1 int primary key, val1 varchar(20));
+insert into t1 values (1, 'test1');
+create table t2 (id2 int primary key, val2 varchar(20));
+insert into t2 values (1, 'test2');
+create algorithm=merge view v1 as select id1 as id1v1, val1 as val1v1 from t1;
+create algorithm=merge view v2 as
+select t2.id2 as id2v2, t2.val2 as val2v2
+from t2, v1
+where t2.id2 = v1.id1v1;
+prepare stmt1 from "update v2 set val2v2 = 'test19' where 1 = id2v2";
+execute stmt1;
+deallocate prepare stmt1;
+drop view v1,v2;
+drop table t1,t2;
--echo # -----------------------------------------------------------------
--echo # -- End of 5.3 tests.
--echo # -----------------------------------------------------------------