391.67.1
by Sergei Glushchenko
Bug 711166 |
1 |
########################################################################
|
2 |
# Bug #711166: Partitioned tables are not correctly handled by the
|
|
3 |
# --databases and --tables-file options of innobackupex,
|
|
4 |
# and by the --tables option of xtrabackup.
|
|
5 |
# Testcase covers using --include option with InnoDB
|
|
6 |
# database
|
|
7 |
########################################################################
|
|
8 |
||
9 |
. inc/common.sh |
|
10 |
. inc/ib_part.sh |
|
11 |
||
12 |
start_server --innodb_file_per_table |
|
13 |
||
14 |
require_partitioning |
|
15 |
||
16 |
# Create InnoDB partitioned table
|
|
17 |
ib_part_init $topdir InnoDB
|
|
18 |
||
19 |
# Saving the checksum of original table
|
|
20 |
checksum_a=`checksum_table test test` |
|
21 |
||
22 |
# Take a backup
|
|
23 |
# Only backup of test.test table will be taken
|
|
24 |
cat >$topdir/tables <<EOF |
|
25 |
test.test
|
|
26 |
EOF
|
|
27 |
innobackupex --no-timestamp --include='test.test$' $topdir/backup |
|
28 |
innobackupex --apply-log $topdir/backup
|
|
29 |
vlog "Backup taken"
|
|
30 |
||
31 |
# also test xtrabackup --stats work with --tables-file
|
|
32 |
COUNT=`xtrabackup --stats --tables='test.test$' --datadir=$topdir/backup \ |
|
33 |
| grep table: | awk '{print $2}' | sort -u | wc -l` |
|
34 |
||
35 |
if [ $COUNT != 7 ] ; then |
|
36 |
vlog "xtrabackup --stats does not work"
|
|
37 |
exit -1
|
|
38 |
fi
|
|
39 |
||
40 |
stop_server |
|
41 |
||
42 |
# Restore partial backup
|
|
43 |
ib_part_restore $topdir $mysql_datadir |
|
44 |
||
45 |
start_server |
|
46 |
||
47 |
ib_part_assert_checksum $checksum_a
|