Commit e30f30d4 authored by Sergei Golubchik's avatar Sergei Golubchik

read_only failures

parent 47dccace
...@@ -20,7 +20,7 @@ id name ...@@ -20,7 +20,7 @@ id name
CREATE user sameea; CREATE user sameea;
CONNECT connn,localhost,sameea,,; CONNECT connn,localhost,sameea,,;
SET Global read_ONLY=ON; SET Global read_ONLY=ON;
ERROR 42000: Access denied; you need (at least one of) the SUPER, READ_ONLY ADMIN privilege(s) for this operation ERROR 42000: Access denied; you need (at least one of) the READ_ONLY ADMIN privilege(s) for this operation
CREATE TABLE t2 CREATE TABLE t2
( (
id INT NOT NULL auto_increment, id INT NOT NULL auto_increment,
......
# #
# MDEV-21960 Bind READ_ONLY ADMIN to @@read_only # MDEV-21960 Bind READ_ONLY ADMIN to @@read_only
# #
# Test that "SET read_only" is not allowed without READ_ONLY ADMIN or SUPER # Test that "SET read_only" is not allowed without READ_ONLY ADMIN
CREATE USER user1@localhost; CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost; GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE READ_ONLY ADMIN, SUPER ON *.* FROM user1@localhost; REVOKE READ_ONLY ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,; connect user1,localhost,user1,,;
connection user1; connection user1;
SET GLOBAL read_only=0; SET GLOBAL read_only=0;
ERROR 42000: Access denied; you need (at least one of) the SUPER, READ_ONLY ADMIN privilege(s) for this operation ERROR 42000: Access denied; you need (at least one of) the READ_ONLY ADMIN privilege(s) for this operation
SET read_only=0; SET read_only=0;
ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SET GLOBAL ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION read_only=0; SET SESSION read_only=0;
...@@ -29,16 +29,3 @@ ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SE ...@@ -29,16 +29,3 @@ ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SE
disconnect user1; disconnect user1;
connection default; connection default;
DROP USER user1@localhost; DROP USER user1@localhost;
# Test that "SET read_only" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL read_only=0;
SET read_only=0;
ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION read_only=0;
ERROR HY000: Variable 'read_only' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
...@@ -3015,7 +3015,7 @@ COMMAND_LINE_ARGUMENT REQUIRED ...@@ -3015,7 +3015,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME READ_ONLY VARIABLE_NAME READ_ONLY
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege VARIABLE_COMMENT Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the 'READ ONLY ADMIN' privilege
NUMERIC_MIN_VALUE NULL NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
......
...@@ -3195,7 +3195,7 @@ COMMAND_LINE_ARGUMENT REQUIRED ...@@ -3195,7 +3195,7 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME READ_ONLY VARIABLE_NAME READ_ONLY
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege VARIABLE_COMMENT Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the 'READ ONLY ADMIN' privilege
NUMERIC_MIN_VALUE NULL NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
--echo # MDEV-21960 Bind READ_ONLY ADMIN to @@read_only --echo # MDEV-21960 Bind READ_ONLY ADMIN to @@read_only
--echo # --echo #
--echo # Test that "SET read_only" is not allowed without READ_ONLY ADMIN or SUPER --echo # Test that "SET read_only" is not allowed without READ_ONLY ADMIN
CREATE USER user1@localhost; CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost; GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE READ_ONLY ADMIN, SUPER ON *.* FROM user1@localhost; REVOKE READ_ONLY ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,) --connect(user1,localhost,user1,,)
--connection user1 --connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR --error ER_SPECIFIC_ACCESS_DENIED_ERROR
...@@ -35,18 +35,3 @@ SET SESSION read_only=0; ...@@ -35,18 +35,3 @@ SET SESSION read_only=0;
--disconnect user1 --disconnect user1
--connection default --connection default
DROP USER user1@localhost; DROP USER user1@localhost;
--echo # Test that "SET read_only" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
SET GLOBAL read_only=0;
--error ER_GLOBAL_VARIABLE
SET read_only=0;
--error ER_GLOBAL_VARIABLE
SET SESSION read_only=0;
--disconnect user1
--connection default
DROP USER user1@localhost;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment