mirror of
https://github.com/MariaDB/server.git
synced 2026-01-25 21:01:45 +01:00
When GRANT EXECUTE ON PROCEDURE fails on the master, it will erroneously be replicated and executed successfully on the slave. This both breaks replication and is a security violation. The underlying issue is that a failed GRANT EXECUTE ON PROCEDURE will still be replicated when sql_mode does not have NO_AUTO_CREATE_USER. This is because the function mysql_routine_grant() does not check if an error occured while performing the GRANT before binlogging, it simply always binlogs. This patch fixes this problem by checking if an error happened previously before binlogging, and if so, then skip binlogging. Note there is still a broader issue in this area leading to replication divergence. Reported in MDEV-29848, a partially-completed GRANT statment (where some earlier GRANTS succeed and a later fails) will not binlog. Note this affects all grant types, whereas the issue addressed in this patch is limited to GRANT EXECUTE ON PROCEDURE. This patch makes GRANT EXECUTE ON PROCEDURE binlogging behavior consistent with the other grant types. A separate follow-up patch will address the broader MDEV-29848 issue. Also note that a test case in rpl_do_grant.test took advantage of MDEV-38506 so a partially-failing REVOKE EXECUTE ON PROCEDURE would still replicate. This test case is disabled with a TODO note to re-enable it once MDEV-29848 is fixed Reviewed-by: Sergei Golubchik <serg@mariadb.org> Signed-off-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com> |
||
|---|---|---|
| .. | ||
| extension | ||
| include | ||
| r | ||
| t | ||
| disabled.def | ||
| my.cnf | ||
| README | ||
| rpl_1slave_base.cnf | ||
How to run. =========== ./mysql-test-run.pl --suite=rpl --mysqld=--binlog-format=mixed