From d86502a7b77d4f50dd4cb18d28e5169e5b0ddf27 Mon Sep 17 00:00:00 2001 From: "Huang, Sophie (sh879n)" Date: Wed, 30 Sep 2020 21:54:22 +0000 Subject: [PATCH] Fix MariaDB backup script When multiple users are granted access to a database, the MariaDB backup script failed to retrieve the grants for that database, which caused the backup job to fail. This patchset updates the script. Change-Id: I9076b2e7363ae0ec216d4e822f385fa949df8f54 --- mariadb/Chart.yaml | 2 +- mariadb/templates/bin/_backup_mariadb.sh.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mariadb/Chart.yaml b/mariadb/Chart.yaml index c921e64561..f9de134997 100644 --- a/mariadb/Chart.yaml +++ b/mariadb/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v10.2.31 description: OpenStack-Helm MariaDB name: mariadb -version: 0.1.2 +version: 0.1.3 home: https://mariadb.com/kb/en/ icon: http://badges.mariadb.org/mariadb-badge-180x60.png sources: diff --git a/mariadb/templates/bin/_backup_mariadb.sh.tpl b/mariadb/templates/bin/_backup_mariadb.sh.tpl index face534e05..5b39446f7f 100644 --- a/mariadb/templates/bin/_backup_mariadb.sh.tpl +++ b/mariadb/templates/bin/_backup_mariadb.sh.tpl @@ -84,7 +84,7 @@ dump_databases_to_directory() { do echo $($MYSQL --skip-column-names -e "select concat('show grants for ',user,';') \ from mysql.db where ucase(db)=ucase('$db');") | \ - sed -r "s/show grants for ([a-zA-Z0-9_-]*)/show grants for '\1'/" | \ + sed -r "s/show grants for ([a-zA-Z0-9_-]*)/show grants for '\1'/g" | \ $MYSQL --silent --skip-column-names 2>>$LOG_FILE > $TMP_DIR/${db}_grant.sql if [ "$?" -eq 0 ] then