Commit 4b0f010b authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-18544 "missing required privilege PROCESS on *.*" using mariabackup for SST

If required privilege is missing, dump the output from "SHOW GRANTS"
into mariabackup log.

This will help troubleshooting, and make the bug reproducible.
parent ada1074b
...@@ -5820,6 +5820,13 @@ check_all_privileges() ...@@ -5820,6 +5820,13 @@ check_all_privileges()
if (check_result & PRIVILEGE_ERROR) { if (check_result & PRIVILEGE_ERROR) {
mysql_close(mysql_connection); mysql_close(mysql_connection);
msg("Current privileges, as reported by 'SHOW GRANTS': ");
int n=1;
for (std::list<std::string>::const_iterator it = granted_privileges.begin();
it != granted_privileges.end();
it++,n++) {
msg(" %d.%s", n, it->c_str());
}
die("Insufficient privileges"); die("Insufficient privileges");
} }
} }
......
CREATE user backup@localhost; CREATE user backup@localhost;
FOUND 1 /missing required privilege RELOAD/ in backup.log FOUND 1 /missing required privilege RELOAD/ in backup.log
FOUND 1 /missing required privilege PROCESS/ in backup.log FOUND 1 /missing required privilege PROCESS/ in backup.log
FOUND 1 /GRANT USAGE ON/ in backup.log
GRANT RELOAD, PROCESS on *.* to backup@localhost; GRANT RELOAD, PROCESS on *.* to backup@localhost;
DROP USER backup@localhost; DROP USER backup@localhost;
...@@ -18,7 +18,8 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log; ...@@ -18,7 +18,8 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log;
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= missing required privilege PROCESS --let SEARCH_PATTERN= missing required privilege PROCESS
--source include/search_pattern_in_file.inc --source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= GRANT USAGE ON
--source include/search_pattern_in_file.inc
# backup succeeds with RELOAD privilege # backup succeeds with RELOAD privilege
GRANT RELOAD, PROCESS on *.* to backup@localhost; GRANT RELOAD, PROCESS on *.* to backup@localhost;
--disable_result_log --disable_result_log
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment