summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-05-02 14:25:24 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2019-05-02 14:25:24 +0100
commit4b0f010b884cb298a33ed438c2b3688c472dbbf7 (patch)
tree9302ccda09156da1df39833ddcff2d9333ad8b28
parentada1074bb10359342ee00e220fe9c172574265fb (diff)
downloadmariadb-git-4b0f010b884cb298a33ed438c2b3688c472dbbf7.tar.gz
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.
-rw-r--r--extra/mariabackup/xtrabackup.cc7
-rw-r--r--mysql-test/suite/mariabackup/backup_grants.result1
-rw-r--r--mysql-test/suite/mariabackup/backup_grants.test3
3 files changed, 10 insertions, 1 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index eae55ddb02e..538d00f0fdb 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -5820,6 +5820,13 @@ check_all_privileges()
if (check_result & PRIVILEGE_ERROR) {
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");
}
}
diff --git a/mysql-test/suite/mariabackup/backup_grants.result b/mysql-test/suite/mariabackup/backup_grants.result
index d8869b7ac82..ed793e7ff1a 100644
--- a/mysql-test/suite/mariabackup/backup_grants.result
+++ b/mysql-test/suite/mariabackup/backup_grants.result
@@ -1,5 +1,6 @@
CREATE user backup@localhost;
FOUND 1 /missing required privilege RELOAD/ 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;
DROP USER backup@localhost;
diff --git a/mysql-test/suite/mariabackup/backup_grants.test b/mysql-test/suite/mariabackup/backup_grants.test
index 1c0c3f89346..eadeedd9b5f 100644
--- a/mysql-test/suite/mariabackup/backup_grants.test
+++ b/mysql-test/suite/mariabackup/backup_grants.test
@@ -18,7 +18,8 @@ let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/backup.log;
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN= missing required privilege PROCESS
--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
GRANT RELOAD, PROCESS on *.* to backup@localhost;
--disable_result_log