diff options
author | unknown <sanja@askmonty.org> | 2014-05-08 22:56:36 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2014-05-08 22:56:36 +0300 |
commit | 45a91d8cbbfb38926f839b9c3cec73a39c5ebffd (patch) | |
tree | 38d2449ef8c78990fed2349baa5be05497d327c9 /mysql-test | |
parent | 3f80740aa8fb24a0f9798e7239f0adb9f910e0a6 (diff) | |
download | mariadb-git-45a91d8cbbfb38926f839b9c3cec73a39c5ebffd.tar.gz |
MDEV-6193: Problems with multi-table updates that JOIN against read-only table
All underlying tables should share the same lock type.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/multi_update.result | 10 | ||||
-rw-r--r-- | mysql-test/t/multi_update.test | 11 |
2 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 7172693d685..aef001c5f95 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -797,6 +797,8 @@ DROP TABLE t1,t2; # # MDEV-6139: UPDATE w/ join against MRG_MyISAM table with read-only # sub-table fails +# MDEV-6193: Problems with multi-table updates that JOIN against +# read-only table # CREATE TABLE t1 ( id int(10) unsigned, @@ -812,5 +814,13 @@ b int(11) ) ENGINE=MRG_MyISAM UNION=(t3); FLUSH TABLES; update t1 join t2 using (id) set t1.a=t2.b; +create view v2 as select * from t2; +update t1 join v2 using (id) set t1.a=0; +create view v1 as select * from t3; +update t1 join v1 using (id) set t1.a=0; +update t1 join INFORMATION_SCHEMA.CHARACTER_SETS on (id=MAXLEN) set t1.a=0; +create view v3 as select t2.id, t3.b from t2 join t3 using(id); +update t1 join v3 using (id) set t1.a=0; +drop view v1, v2, v3; drop table t2, t3, t1; end of 5.5 tests diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 7acebfbed53..12b534f1473 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -811,6 +811,8 @@ DROP TABLE t1,t2; --echo # --echo # MDEV-6139: UPDATE w/ join against MRG_MyISAM table with read-only --echo # sub-table fails +--echo # MDEV-6193: Problems with multi-table updates that JOIN against +--echo # read-only table --echo # CREATE TABLE t1 ( @@ -837,7 +839,14 @@ let $MYSQLD_DATADIR= `select @@datadir`; --enable_result_log update t1 join t2 using (id) set t1.a=t2.b; - +create view v2 as select * from t2; +update t1 join v2 using (id) set t1.a=0; +create view v1 as select * from t3; +update t1 join v1 using (id) set t1.a=0; +update t1 join INFORMATION_SCHEMA.CHARACTER_SETS on (id=MAXLEN) set t1.a=0; +create view v3 as select t2.id, t3.b from t2 join t3 using(id); +update t1 join v3 using (id) set t1.a=0; +drop view v1, v2, v3; drop table t2, t3, t1; --echo end of 5.5 tests |