diff options
author | Alexander Barkov <bar@mariadb.com> | 2020-03-18 12:50:17 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2020-03-18 12:50:17 +0400 |
commit | 1ddc1fc305e53549fa972bf3a5e76799c00e7852 (patch) | |
tree | e31644324b8c0f6bd6b51558b0808975ba74d467 /sql | |
parent | 965fa626174a2ac731ff885c477928a903b83812 (diff) | |
download | mariadb-git-1ddc1fc305e53549fa972bf3a5e76799c00e7852.tar.gz |
MDEV-21971 Bind BINLOG ADMIN to binlog_annotate_row_events and binlog_row_image global and session variables
Diffstat (limited to 'sql')
-rw-r--r-- | sql/privilege.h | 6 | ||||
-rw-r--r-- | sql/sys_vars.cc | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sql/privilege.h b/sql/privilege.h index 0dd3712650a..1a11c1bb4ad 100644 --- a/sql/privilege.h +++ b/sql/privilege.h @@ -322,6 +322,12 @@ constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_FORMAT= constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES= SUPER_ACL | BINLOG_ADMIN_ACL; +constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_ANNOTATE_ROW_EVENTS= + SUPER_ACL | BINLOG_ADMIN_ACL; + +constexpr privilege_t PRIV_SET_SYSTEM_VAR_BINLOG_ROW_IMAGE= + SUPER_ACL | BINLOG_ADMIN_ACL; + constexpr privilege_t PRIV_SET_SYSTEM_VAR_SQL_LOG_BIN= SUPER_ACL | BINLOG_ADMIN_ACL; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 72bf4178872..924cf914520 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -6314,7 +6314,10 @@ static Sys_var_mybool Sys_userstat( GLOBAL_VAR(opt_userstat_running), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -static Sys_var_mybool Sys_binlog_annotate_row_events( +static Sys_var_on_access<Sys_var_mybool, + PRIV_SET_SYSTEM_VAR_BINLOG_ANNOTATE_ROW_EVENTS, + PRIV_SET_SYSTEM_VAR_BINLOG_ANNOTATE_ROW_EVENTS> +Sys_binlog_annotate_row_events( "binlog_annotate_row_events", "Tells the master to annotate RBR events with the statement that " "caused these events", @@ -6428,7 +6431,10 @@ static Sys_var_mybool Sys_binlog_encryption( DEFAULT(FALSE)); static const char *binlog_row_image_names[]= {"MINIMAL", "NOBLOB", "FULL", NullS}; -static Sys_var_enum Sys_binlog_row_image( +static Sys_var_on_access<Sys_var_enum, + PRIV_SET_SYSTEM_VAR_BINLOG_ROW_IMAGE, + PRIV_SET_SYSTEM_VAR_BINLOG_ROW_IMAGE> +Sys_binlog_row_image( "binlog_row_image", "Controls whether rows should be logged in 'FULL', 'NOBLOB' or " "'MINIMAL' formats. 'FULL', means that all columns in the before " |