diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2018-12-12 19:58:20 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2018-12-13 20:52:23 +0400 |
commit | 15eaeace394320d96b6bf193f9e049f9358d2b07 (patch) | |
tree | 602c5eec614d2aea0073fe34e5cedad1e0bdbe7b /mysql-test | |
parent | 32b7d456d5da193c8797e20467f6eac0a6b0c39a (diff) | |
download | mariadb-git-15eaeace394320d96b6bf193f9e049f9358d2b07.tar.gz |
MDEV-16987 - ALTER DATABASE possible in read-only mode
Forbid ALTER DATABASE under read_only.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/read_only.result | 11 | ||||
-rw-r--r-- | mysql-test/t/read_only.test | 13 |
2 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result index 2d0f9d730fd..4afddab6851 100644 --- a/mysql-test/r/read_only.result +++ b/mysql-test/r/read_only.result @@ -162,3 +162,14 @@ delete from mysql.columns_priv where User like 'mysqltest_%'; flush privileges; drop database mysqltest_db1; set global read_only= @start_read_only; +# +# MDEV-16987 - ALTER DATABASE possible in read-only mode +# +GRANT ALTER ON test1.* TO user1@localhost; +CREATE DATABASE test1; +SET GLOBAL read_only=1; +ALTER DATABASE test1 CHARACTER SET utf8; +ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement +SET GLOBAL read_only=0; +DROP DATABASE test1; +DROP USER user1@localhost; 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; |