summaryrefslogtreecommitdiff
path: root/mysql-test/main/multi_update.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-05-12 17:20:23 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-05-12 17:20:23 +0200
commitc51f85f8823a845cd4a6aa1b2aa5af18484b2ab0 (patch)
tree65c45f6100c13dad90c33b86dc68be268139b0b8 /mysql-test/main/multi_update.test
parenta89f199c64a1d2339de7c167ce64ec148061a4d3 (diff)
parent8ce702aa90c174566f4ac950e85cc7570bf9b647 (diff)
downloadmariadb-git-c51f85f8823a845cd4a6aa1b2aa5af18484b2ab0.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'mysql-test/main/multi_update.test')
-rw-r--r--mysql-test/main/multi_update.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/main/multi_update.test b/mysql-test/main/multi_update.test
index 42e34d1e4a1..b6ad8bfcf52 100644
--- a/mysql-test/main/multi_update.test
+++ b/mysql-test/main/multi_update.test
@@ -899,6 +899,37 @@ deallocate prepare stmt1;
drop view v3,v2,v1;
drop table t1,t2,t3;
+
+#
+# MDEV-18507 can't update temporary table when joined with table with triggers on read-only
+#
+create table t1 (id int not null, v1 varchar(10) not null);
+insert into t1 values (1,1),(2,2);
+create table t2 (log varchar(10) not null);
+create trigger t1_after_update after update on t1
+ for each row insert into t2 values ('triggered');
+
+create user foo;
+grant select, insert, update, delete, create, drop, reload, index, alter, show databases, create temporary tables, lock tables, execute, create view, show view, create routine, alter routine, trigger on *.* to 'foo'@'%';
+
+set global read_only=1;
+connect a, localhost, foo;
+
+create temporary table temp_t1 (id int not null, update_me varchar(10));
+insert into temp_t1 values (1,1),(2,2),(3,3);
+update temp_t1 left join t1 on temp_t1.id = t1.id set temp_t1.update_me = 'hello';
+
+connection default;
+set global read_only = 0;
+
+create table t3 (id int not null);
+insert t3 values (2);
+update t1 left join t3 on t1.id = t3.id set t1.v1 = 'hello';
+select * from t2;
+
+drop table t1,t2, t3;
+drop user foo;
+
--echo end of 5.5 tests
#