From 15eaeace394320d96b6bf193f9e049f9358d2b07 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 12 Dec 2018 19:58:20 +0400 Subject: MDEV-16987 - ALTER DATABASE possible in read-only mode Forbid ALTER DATABASE under read_only. --- mysql-test/t/read_only.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t/read_only.test') diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test index eb9bea803c2..dd9d6430172 100644 --- a/mysql-test/t/read_only.test +++ b/mysql-test/t/read_only.test @@ -310,3 +310,16 @@ set global read_only= @start_read_only; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc +--echo # +--echo # MDEV-16987 - ALTER DATABASE possible in read-only mode +--echo # +GRANT ALTER ON test1.* TO user1@localhost; +CREATE DATABASE test1; +SET GLOBAL read_only=1; +change_user user1; +--error ER_OPTION_PREVENTS_STATEMENT +ALTER DATABASE test1 CHARACTER SET utf8; +change_user root; +SET GLOBAL read_only=0; +DROP DATABASE test1; +DROP USER user1@localhost; -- cgit v1.2.1