Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
91c6e6df
Commit
91c6e6df
authored
Mar 18, 2020
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
parent
535c284a
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
546 additions
and
9 deletions
+546
-9
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result
...uite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result
...uite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result
.../sys_vars/r/rpl_semi_sync_master_trace_level_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result
...ys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result
...e/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result
.../sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result
...suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result
...vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result
+46
-0
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result
...e/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result
+46
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_grant.test
.../suite/sys_vars/t/rpl_semi_sync_master_enabled_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_grant.test
.../suite/sys_vars/t/rpl_semi_sync_master_timeout_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_grant.test
...te/sys_vars/t/rpl_semi_sync_master_trace_level_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_grant.test
.../sys_vars/t/rpl_semi_sync_master_wait_no_slave_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_grant.test
...ite/sys_vars/t/rpl_semi_sync_master_wait_point_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_delay_master_grant.test
...te/sys_vars/t/rpl_semi_sync_slave_delay_master_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_grant.test
...t/suite/sys_vars/t/rpl_semi_sync_slave_enabled_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_kill_conn_timeout_grant.test
...s_vars/t/rpl_semi_sync_slave_kill_conn_timeout_grant.test
+9
-0
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_grant.test
...ite/sys_vars/t/rpl_semi_sync_slave_trace_level_grant.test
+9
-0
sql/privilege.h
sql/privilege.h
+24
-0
sql/sys_vars.cc
sql/sys_vars.cc
+27
-9
No files found.
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_enabled;
# Test that "SET rpl_semi_sync_master_enabled" is not allowed without REPLICATION MASTER ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_enabled=1;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_enabled" is allowed with REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION MASTER ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_enabled=1;
SET rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_enabled" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_enabled=1;
SET rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_enabled=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_timeout;
# Test that "SET rpl_semi_sync_master_timeout" is not allowed without REPLICATION MASTER ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_timeout=20000;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_timeout" is allowed with REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION MASTER ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_timeout=20000;
SET rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_timeout" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_timeout=20000;
SET rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_timeout=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_trace_level;
# Test that "SET rpl_semi_sync_master_trace_level" is not allowed without REPLICATION MASTER ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_trace_level=64;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_trace_level" is allowed with REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION MASTER ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_trace_level=64;
SET rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_trace_level" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_trace_level=64;
SET rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_trace_level=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_wait_no_slave;
# Test that "SET rpl_semi_sync_master_wait_no_slave" is not allowed without REPLICATION MASTER ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_no_slave=1;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_wait_no_slave" is allowed with REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION MASTER ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_no_slave=1;
SET rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_wait_no_slave" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_no_slave=1;
SET rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_wait_no_slave=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_wait_point;
# Test that "SET rpl_semi_sync_master_wait_point" is not allowed without REPLICATION MASTER ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_wait_point" is allowed with REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION MASTER ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_point=AFTER_SYNC;
SET rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_master_wait_point" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_point=AFTER_SYNC;
SET rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_wait_point=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_delay_master;
# Test that "SET rpl_semi_sync_slave_delay_master" is not allowed without REPLICATION SLAVE ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_delay_master=1;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_delay_master" is allowed with REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION SLAVE ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_delay_master=1;
SET rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_delay_master" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_delay_master=1;
SET rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_delay_master=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_enabled;
# Test that "SET rpl_semi_sync_slave_enabled" is not allowed without REPLICATION SLAVE ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_enabled=1;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_enabled" is allowed with REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION SLAVE ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_enabled=1;
SET rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_enabled" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_enabled=1;
SET rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_enabled=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_kill_conn_timeout;
# Test that "SET rpl_semi_sync_slave_kill_conn_timeout" is not allowed without REPLICATION SLAVE ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_kill_conn_timeout" is allowed with REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION SLAVE ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout=1;
SET rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_kill_conn_timeout" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout=1;
SET rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_kill_conn_timeout=@global;
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result
0 → 100644
View file @
91c6e6df
#
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_trace_level;
# Test that "SET rpl_semi_sync_slave_trace_level" is not allowed without REPLICATION SLAVE ADMIN or SUPER
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_trace_level=64;
ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_trace_level" is allowed with REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT REPLICATION SLAVE ADMIN ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_trace_level=64;
SET rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
# Test that "SET rpl_semi_sync_slave_trace_level" is allowed with SUPER
CREATE USER user1@localhost;
GRANT SUPER ON *.* TO user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_trace_level=64;
SET rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
disconnect user1;
connection default;
DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_trace_level=@global;
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_enabled_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_master_enabled
--
let
grant
=
REPLICATION
MASTER
ADMIN
--
let
value
=
1
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_timeout_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_master_timeout
--
let
grant
=
REPLICATION
MASTER
ADMIN
--
let
value
=
20000
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_trace_level_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_master_trace_level
--
let
grant
=
REPLICATION
MASTER
ADMIN
--
let
value
=
64
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_no_slave_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_master_wait_no_slave
--
let
grant
=
REPLICATION
MASTER
ADMIN
--
let
value
=
1
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_master_wait_point_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_master_wait_point
--
let
grant
=
REPLICATION
MASTER
ADMIN
--
let
value
=
AFTER_SYNC
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_delay_master_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_slave_delay_master
--
let
grant
=
REPLICATION
SLAVE
ADMIN
--
let
value
=
1
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_enabled_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_slave_enabled
--
let
grant
=
REPLICATION
SLAVE
ADMIN
--
let
value
=
1
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_kill_conn_timeout_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_slave_kill_conn_timeout
--
let
grant
=
REPLICATION
SLAVE
ADMIN
--
let
value
=
1
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
mysql-test/suite/sys_vars/t/rpl_semi_sync_slave_trace_level_grant.test
0 → 100644
View file @
91c6e6df
--
echo
#
--
echo
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
--
echo
#
--
let
var
=
rpl_semi_sync_slave_trace_level
--
let
grant
=
REPLICATION
SLAVE
ADMIN
--
let
value
=
64
--
source
suite
/
sys_vars
/
inc
/
sysvar_global_grant
.
inc
sql/privilege.h
View file @
91c6e6df
...
...
@@ -461,6 +461,21 @@ constexpr privilege_t PRIV_COM_BINLOG_DUMP= REPL_SLAVE_ACL;
// Was REPL_SLAVE_ACL prior to 10.5.2
constexpr
privilege_t
PRIV_STMT_SHOW_SLAVE_HOSTS
=
REPL_MASTER_ADMIN_ACL
;
/*
Replication master related variable privileges.
Where SUPER prior to 10.5.2
*/
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_ENABLED
=
REPL_MASTER_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_TIMEOUT
=
REPL_MASTER_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE
=
REPL_MASTER_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_TRACE_LEVEL
=
REPL_MASTER_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_WAIT_POINT
=
REPL_MASTER_ADMIN_ACL
|
SUPER_ACL
;
/* Privileges for statements that are executed on the slave */
// Was SUPER_ACL prior to 10.5.2
...
...
@@ -528,6 +543,15 @@ constexpr privilege_t PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_TYPE_CONVERSIONS=
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_INIT_SLAVE
=
REPL_SLAVE_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_ENABLED
=
REPL_SLAVE_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL
=
REPL_SLAVE_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_DELAY_MASTER
=
REPL_SLAVE_ADMIN_ACL
|
SUPER_ACL
;
constexpr
privilege_t
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_KILL_CONN_TIMEOUT
=
REPL_SLAVE_ADMIN_ACL
|
SUPER_ACL
;
/* Privileges for federated database related statements */
// Was SUPER_ACL prior to 10.5.2
...
...
sql/sys_vars.cc
View file @
91c6e6df
...
...
@@ -3389,7 +3389,9 @@ static bool fix_rpl_semi_sync_master_wait_no_slave(sys_var *self, THD *thd,
return
false
;
}
static
Sys_var_mybool
Sys_semisync_master_enabled
(
static
Sys_var_on_access_global
<
Sys_var_mybool
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_ENABLED
>
Sys_semisync_master_enabled
(
"rpl_semi_sync_master_enabled"
,
"Enable semi-synchronous replication master (disabled by default)."
,
GLOBAL_VAR
(
rpl_semi_sync_master_enabled
),
...
...
@@ -3397,7 +3399,9 @@ static Sys_var_mybool Sys_semisync_master_enabled(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_rpl_semi_sync_master_enabled
));
static
Sys_var_ulong
Sys_semisync_master_timeout
(
static
Sys_var_on_access_global
<
Sys_var_ulong
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_TIMEOUT
>
Sys_semisync_master_timeout
(
"rpl_semi_sync_master_timeout"
,
"The timeout value (in ms) for semi-synchronous replication in the "
"master"
,
...
...
@@ -3407,7 +3411,9 @@ static Sys_var_ulong Sys_semisync_master_timeout(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_rpl_semi_sync_master_timeout
));
static
Sys_var_mybool
Sys_semisync_master_wait_no_slave
(
static
Sys_var_on_access_global
<
Sys_var_mybool
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_WAIT_NO_SLAVE
>
Sys_semisync_master_wait_no_slave
(
"rpl_semi_sync_master_wait_no_slave"
,
"Wait until timeout when no semi-synchronous replication slave "
"available (enabled by default)."
,
...
...
@@ -3416,7 +3422,9 @@ static Sys_var_mybool Sys_semisync_master_wait_no_slave(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_rpl_semi_sync_master_wait_no_slave
));
static
Sys_var_ulong
Sys_semisync_master_trace_level
(
static
Sys_var_on_access_global
<
Sys_var_ulong
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_TRACE_LEVEL
>
Sys_semisync_master_trace_level
(
"rpl_semi_sync_master_trace_level"
,
"The tracing level for semi-sync replication."
,
GLOBAL_VAR
(
rpl_semi_sync_master_trace_level
),
...
...
@@ -3428,7 +3436,9 @@ static Sys_var_ulong Sys_semisync_master_trace_level(
static
const
char
*
repl_semisync_wait_point
[]
=
{
"AFTER_SYNC"
,
"AFTER_COMMIT"
,
NullS
};
static
Sys_var_enum
Sys_semisync_master_wait_point
(
static
Sys_var_on_access_global
<
Sys_var_enum
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_MASTER_WAIT_POINT
>
Sys_semisync_master_wait_point
(
"rpl_semi_sync_master_wait_point"
,
"Should transaction wait for semi-sync ack after having synced binlog, "
"or after having committed in storage engine."
,
...
...
@@ -3466,7 +3476,9 @@ static bool fix_rpl_semi_sync_slave_kill_conn_timeout(sys_var *self, THD *thd,
return
false
;
}
static
Sys_var_mybool
Sys_semisync_slave_enabled
(
static
Sys_var_on_access_global
<
Sys_var_mybool
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_ENABLED
>
Sys_semisync_slave_enabled
(
"rpl_semi_sync_slave_enabled"
,
"Enable semi-synchronous replication slave (disabled by default)."
,
GLOBAL_VAR
(
rpl_semi_sync_slave_enabled
),
...
...
@@ -3474,7 +3486,9 @@ static Sys_var_mybool Sys_semisync_slave_enabled(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_rpl_semi_sync_slave_enabled
));
static
Sys_var_ulong
Sys_semisync_slave_trace_level
(
static
Sys_var_on_access_global
<
Sys_var_ulong
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL
>
Sys_semisync_slave_trace_level
(
"rpl_semi_sync_slave_trace_level"
,
"The tracing level for semi-sync replication."
,
GLOBAL_VAR
(
rpl_semi_sync_slave_trace_level
),
...
...
@@ -3483,7 +3497,9 @@ static Sys_var_ulong Sys_semisync_slave_trace_level(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_rpl_semi_sync_slave_trace_level
));
static
Sys_var_mybool
Sys_semisync_slave_delay_master
(
static
Sys_var_on_access_global
<
Sys_var_mybool
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_DELAY_MASTER
>
Sys_semisync_slave_delay_master
(
"rpl_semi_sync_slave_delay_master"
,
"Only write master info file when ack is needed."
,
GLOBAL_VAR
(
rpl_semi_sync_slave_delay_master
),
...
...
@@ -3491,7 +3507,9 @@ static Sys_var_mybool Sys_semisync_slave_delay_master(
NO_MUTEX_GUARD
,
NOT_IN_BINLOG
,
ON_CHECK
(
0
),
ON_UPDATE
(
fix_rpl_semi_sync_slave_delay_master
));
static
Sys_var_uint
Sys_semisync_slave_kill_conn_timeout
(
static
Sys_var_on_access_global
<
Sys_var_uint
,
PRIV_SET_SYSTEM_GLOBAL_VAR_RPL_SEMI_SYNC_SLAVE_KILL_CONN_TIMEOUT
>
Sys_semisync_slave_kill_conn_timeout
(
"rpl_semi_sync_slave_kill_conn_timeout"
,
"Timeout for the mysql connection used to kill the slave io_thread's "
"connection on master. This timeout comes into play when stop slave "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment