~sergei.glushchenko/percona-xtrabackup/xb21-part-test

« back to all changes in this revision

Viewing changes to innobackupex

  • Committer: Sergei Glushchenko
  • Date: 2012-12-18 12:27:37 UTC
  • mfrom: (391.64.1 xb20-partial)
  • Revision ID: sergei.glushchenko@percona.com-20121218122737-c5y5zk5zwuu3moor
Merge fix for Bug 711166 from 2.0 series

Show diffs side-by-side

added added

removed removed

Lines of Context:
1993
1993
            next unless check_if_required($database, $file);
1994
1994
 
1995
1995
            if($option_include) {
1996
 
              if (!("$database.$file" =~ /$option_include/)) {
 
1996
              my $table_name = get_table_name($file);
 
1997
              if (!("$database.$table_name" =~ /$option_include/)) {
1997
1998
                print STDERR "$database.$file is skipped because it does not match $option_include.\n";
1998
1999
                next;
1999
2000
              }
2315
2316
    return ${$group_hash_ref}{$option_name};
2316
2317
}
2317
2318
 
 
2319
# get_table_name subroutine returns table name of specified file.
 
2320
#    Parameters:
 
2321
#       $_[0]        table path
 
2322
#    Return value:
 
2323
#       1 table name
 
2324
#
 
2325
sub get_table_name {
 
2326
   my $table_path = shift;
 
2327
   my $filename;
 
2328
   my $table;
 
2329
 
 
2330
   # get the last component in the table pathname 
 
2331
   $filename = (reverse(split(/\//, $table_path)))[0];
 
2332
   # get name of the table by removing file suffix
 
2333
   $table = (split(/\./, $filename))[0];
 
2334
   # and partition suffix
 
2335
   $table = (split('#P#', $table))[0];
 
2336
 
 
2337
   return $table;
 
2338
}
2318
2339
 
2319
2340
# check_if_required subroutine returns 1 if the specified database and
2320
2341
# table needs to be backed up.
2328
2349
   my ( $db, $table_path ) = @_;
2329
2350
   my $db_count  = scalar keys %databases_list;
2330
2351
   my $tbl_count = scalar keys %table_list;
2331
 
   my $filename;
2332
2352
   my $table;
2333
2353
 
2334
2354
   if ( $db_count == 0 && $tbl_count == 0 ) {
2338
2358
   }
2339
2359
   else {
2340
2360
      if ( $table_path ) {
2341
 
         # get the last component in the table pathname 
2342
 
         $filename = (reverse(split(/\//, $table_path)))[0];
2343
 
         # get name of the table by removing file suffix
2344
 
         $table = (split(/\./, $filename))[0];
 
2361
         $table = get_table_name($table_path);
2345
2362
      }
2346
2363
   }
2347
2364