From 44a7ee8912fd2dca14f5b6d01e4d96b6d11b727c Mon Sep 17 00:00:00 2001
From: ibauer <ilja.bauer@devboost.de>
Date: Fri, 21 Jul 2017 16:12:39 +0200
Subject: [PATCH] #11148: skip dumping information|performance_schema in mysql
 handler

---
 handlers/mysql.in | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/handlers/mysql.in b/handlers/mysql.in
index ceed620..094dc5f 100644
--- a/handlers/mysql.in
+++ b/handlers/mysql.in
@@ -238,14 +238,14 @@ then
    then
       if [ $usevserver = yes ]
       then
-         debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database'
-         databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database`
+         debug 'set -o pipefail ; echo show databases | $VSERVER $vsname exec su $user -c \"$MYSQL $defaultsfile\" | grep -v Database | grep -v \'^\(information\|performance\)_schema$\''
+         databases=`set -o pipefail ; echo 'show databases' | $VSERVER $vsname exec su $user -c "$MYSQL $defaultsfile" | grep -v Database | grep -v '^\(information\|performance\)_schema$'`
          if [ $? -ne 0 ]
          then
             fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"
          fi
       else
-         databases=$(set -o pipefail ; su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d')
+         databases=$(set -o pipefail ; su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d;/^\(information\|performance\)_schema$/d')
          if [ $? -ne 0 ]
          then
             fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"
@@ -257,15 +257,6 @@ then
    do
       DUMP_BASE="$MYSQLDUMP $defaultsfile $sqldumpoptions"
 
-      case "$db" in
-         information_schema)
-            DUMP_BASE="${DUMP_BASE} --skip-lock-tables"
-            ;;
-         performance_schema)
-            DUMP_BASE="${DUMP_BASE} --skip-lock-tables --skip-events"
-            ;;
-      esac
-
       # Dumping structure and data
       DUMP="$DUMP_BASE $ignore $db"
 
-- 
GitLab