File mysql-community-server-5.1.36-hotcopy.patch of Package mariadb.import4864

PATCH-P0-FIX-UPSTREAM: Makes hotcopy to ignores log tables
BUGS: upstream#43594, bnc#525325

If you are running hotcopy, you probably want to ignore all
log tables.

Maintainer: Michal Hrusecky <mhrusecky@suse.cz>

=== modified file 'scripts/mysqlhotcopy.sh'
--- scripts/mysqlhotcopy.sh	2008-03-07 20:45:40 +0000
+++ scripts/mysqlhotcopy.sh	2009-03-12 13:06:42 +0000
@@ -777,7 +777,24 @@ sub get_list_of_tables {
         } || [];
     warn "Unable to retrieve list of tables in $db: $@" if $@;
 
-    return (map { $_->[0] } @$tables);
+    my @ignore_tables = ();
+
+    # Ignore tables for the mysql database
+    if ($db eq 'mysql') {
+        @ignore_tables = qw(general_log slow_log schema apply_status);
+    }
+
+    my @res = ();
+    if ($#ignore_tables > 1) {
+       my @tmp = (map { $_->[0] } @$tables);
+       for my $t (@tmp) {
+           push(@res, $t) if not exists { map { $_=>1 } @ignore_tables }->{$t};
+       }
+    } else {
+       @res = (map { $_->[0] } @$tables);
+    }
+
+    return @res;
 }
 
 sub quote_names {

openSUSE Build Service is sponsored by