diff options
author | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-04-26 19:51:42 -0600 |
---|---|---|
committer | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-04-29 17:01:05 -0600 |
commit | 960223da39e6e7704b3b0e2de9fda404cc5f8d51 (patch) | |
tree | 101c69694eac4ebd4a306131cdadcdf66392bf93 /sql/set_var.cc | |
parent | 388032e99057449219d4a943b4407e36c42ec4af (diff) | |
download | mariadb-git-10.2-MDEV-28294-pre-exec.tar.gz |
MDEV-28294: set default role bypasses Replicate_Wild_Ignore_Table: mysql.%10.2-MDEV-28294-pre-exec
Problem:
========
When replicating SET DEFAULT ROLE, the pre-update check (i.e. that
in set_var_default_role::check()) tries to validate the existence of
the given rules/user even when the targeted tables are ignored. When
previously issued CREATE USER/ROLE commands are ignored by the
replica because of the replication filtering rules, this results in
an error because the targeted data does not exist.
Solution:
========
Before checking that the given rules/user exist of a SET DEFAULT
ROLE command, first ensure that the mysql.user and
mysql.roles_mapping tables are not excluded by replication filters.
Reviewed By
===========
Andrei Elkin <andrei.elkin@mariadb.com>
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 569362fb7bd..60ed4c8dc5c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -936,6 +936,14 @@ int set_var_password::update(THD *thd) #endif } +void set_var_password::get_modified_tables(TABLE_LIST **tables) +{ + size_t n_tables; + acl_get_tables_set_password(&user_table, &n_tables); + DBUG_ASSERT(n_tables == 1); + *tables= &user_table; +} + /***************************************************************************** Functions to handle SET ROLE *****************************************************************************/ @@ -1001,6 +1009,14 @@ int set_var_default_role::update(THD *thd) #endif } +void set_var_default_role::get_modified_tables(TABLE_LIST **tables) +{ + size_t n_tables; + acl_get_tables_set_default_role(&roles_mapping_table, &n_tables); + DBUG_ASSERT(n_tables == 1); + *tables= &roles_mapping_table; +} + /***************************************************************************** Functions to handle SET NAMES and SET CHARACTER SET *****************************************************************************/ |