You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG# 35020512 - Provide an option in mysqldump to disable
FLUSH TABLES WITH READ LOCK so that RELOAD privilege is
not required [mysql-5.7]
Problem:
-------
Starting mysqldump with --single-transaction is throwing the below
error for users without the RELOAD privilege:
mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need
(at least one of) the RELOAD privilege(s) for this operation (1227)
Analysis:
---------
The changes made in the bug fix of 33630199 caused a regression
in which whenever user passes --single-transaction, mysqldump
tries to perform FLUSH TABLES WITH READ LOCK.
Now "FLUSH TABLES" operation requires the users to have the RELOAD
privilege, and many dump users do not have this privilege.
This FLUSH TABLES was required in the case of bug 33630199 where
it had issues with GTID consistency, and FLUSH TABLES was solving
this issue, but the FLUSH TABLES is not required for every dump
started with --single-transaction. It is needed only when the
server has GTIDs enabled and --set-gtid-purged is set to ON or AUTO.
This is how it was checking if FLUSH TABLES is needed, previously:
if ((opt_lock_all_tables || opt_master_data ||
(opt_single_transaction && flush_logs)) &&
do_flush_tables_read_lock(mysql))
goto err;
after the bug fix of 33630199, it was changed to this
if ((opt_lock_all_tables || opt_master_data ||
opt_single_transaction) &&
do_flush_tables_read_lock(mysql))
goto err;
and this, performs FLUSH TABLES every time the user
passes --single-transaction.
Fix:
----
The fix is to perform FLUSH TABLES only when GTIDs are enabled
on the server, AND --set-gtid-purged is set to ON /or/ AUTO
No need to perform FLUSH TABLES for every dump started
with --single-transaction.
Restored the previous if block, with one additional check
for condition mentioned above.
Change-Id: I08bcf3813b6a9d405863c1e9f667c85b3e059288
0 commit comments