~akopytov/percona-xtrabackup/bugs_665210_and_810269-1.7

« back to all changes in this revision

Viewing changes to test/t/bug810269.sh

  • Committer: Alexey Kopytov
  • Date: 2011-07-18 09:32:48 UTC
  • mfrom: (242.10.2 1.6)
  • Revision ID: akopytov@gmail.com-20110718093248-voomf1sv41lubqb0
Bug #665210: tar4ibd does not support innodb row_format=compressed
Bug #810269: tar4ibd does not check for doublewrite buffer pages

1. Merged the fix proposed by Andrew Garner in bug #665210 which adds
support for compressed tables to tar4ibd.

2. Added checks for doublewrite buffer pages to tar4ibd to fix bug
#810269.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
########################################################################
 
2
# Bug #665210: tar4ibd does not support innodb row_format=compressed
 
3
# Bug #810269: tar4ibd does not check for doublewrite buffer pages
 
4
########################################################################
 
5
 
 
6
. inc/common.sh
 
7
 
 
8
init
 
9
 
 
10
if [ -z "$INNODB_VERSION" ]; then
 
11
    echo "Requires InnoDB plugin or XtraDB" >$SKIPPED_REASON
 
12
    exit $SKIPPED_EXIT_CODE
 
13
fi
 
14
 
 
15
run_mysqld "--innodb_strict_mode --innodb_file_per_table \
 
16
--innodb_file_format=Barracuda"
 
17
 
 
18
load_dbase_schema incremental_sample
 
19
 
 
20
vlog "Compressing the table"
 
21
 
 
22
run_cmd $MYSQL $MYSQL_ARGS -e \
 
23
    "ALTER TABLE test ENGINE=InnoDB ROW_FORMAT=compressed \
 
24
KEY_BLOCK_SIZE=4" incremental_sample
 
25
 
 
26
vlog "Adding initial rows to table"
 
27
 
 
28
numrow=10000
 
29
count=0
 
30
while [ "$numrow" -gt "$count" ]; do
 
31
    sql="INSERT INTO test VALUES ($count, $numrow)"
 
32
    let "count=count+1"
 
33
    for ((i=0; $i<99; i++)); do
 
34
        sql="$sql,($count, $numrow)"
 
35
        let "count=count+1"
 
36
    done
 
37
    ${MYSQL} ${MYSQL_ARGS} -e "$sql" incremental_sample
 
38
done
 
39
 
 
40
rows=`${MYSQL} ${MYSQL_ARGS} -Ns -e "SELECT COUNT(*) FROM test" \
 
41
    incremental_sample`
 
42
if [ "$rows" != "10000" ]; then
 
43
    vlog "Failed to add initial rows"
 
44
    exit -1
 
45
fi
 
46
 
 
47
vlog "Initial rows added"
 
48
 
 
49
checksum_a=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" \
 
50
incremental_sample | awk '{print $2}'`
 
51
 
 
52
vlog "Starting streaming backup"
 
53
 
 
54
mkdir -p $topdir/backup
 
55
 
 
56
innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar
 
57
 
 
58
stop_mysqld
 
59
rm -rf $mysql_datadir
 
60
 
 
61
vlog "Applying log"
 
62
 
 
63
cd $topdir/backup
 
64
$TAR -ixvf out.tar
 
65
cd -
 
66
innobackupex --apply-log $topdir/backup
 
67
 
 
68
vlog "Restoring MySQL datadir"
 
69
mkdir -p $mysql_datadir
 
70
innobackupex --copy-back $topdir/backup
 
71
 
 
72
run_mysqld
 
73
 
 
74
checksum_b=`${MYSQL} ${MYSQL_ARGS} -Ns -e "checksum table test;" \
 
75
incremental_sample | awk '{print $2}'`
 
76
 
 
77
if [ "$checksum_a" != "$checksum_b" ]; then
 
78
    vlog "Checksums do not match"
 
79
    exit -1
 
80
fi
 
81
 
 
82
vlog "Checksums are OK"