~laurynas-biveinis/percona-xtrabackup/bug1021249-2.1

« back to all changes in this revision

Viewing changes to test/t/xb_incremental.sh

  • Committer: Laurynas Biveinis
  • Date: 2012-08-01 11:06:20 UTC
  • mfrom: (391.40.3 bug1021249-2.0)
  • Revision ID: laurynas.biveinis@percona.com-20120801110620-2y0th7pzaeiv38je
Automerge bug 1021249 fix from 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
vlog "Making changes to database"
38
38
 
 
39
${MYSQL} ${MYSQL_ARGS} -e "create table t2 (a int(11) default null, number int(11) default null) engine=innodb" incremental_sample
39
40
let "count=numrow+1"
40
 
let "numrow=500"
 
41
let "numrow=1000"
41
42
while [ "$numrow" -gt "$count" ]
42
43
do
43
44
        ${MYSQL} ${MYSQL_ARGS} -e "insert into test values ($count, $numrow);" incremental_sample
 
45
        ${MYSQL} ${MYSQL_ARGS} -e "insert into t2 values ($count, $numrow);" incremental_sample
44
46
        let "count=count+1"
45
47
done
46
48
 
47
49
vlog "Changes done"
48
50
 
49
51
# Saving the checksum of original table
50
 
checksum_a=`checksum_table incremental_sample test`
 
52
checksum_test_a=`checksum_table incremental_sample test`
 
53
checksum_t2_a=`checksum_table incremental_sample t2`
51
54
 
52
 
vlog "Table checksum is $checksum_a"
 
55
vlog "Table 'test' checksum is $checksum_test_a"
 
56
vlog "Table 't2' checksum is $checksum_t2_a"
53
57
vlog "Making incremental backup"
54
58
 
55
59
# Incremental backup
69
73
vlog "Data prepared for restore"
70
74
 
71
75
# removing rows
72
 
vlog "Table cleared"
73
76
run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from test;" incremental_sample
 
77
run_cmd ${MYSQL} ${MYSQL_ARGS} -e "delete from t2;" incremental_sample
 
78
vlog "Tables cleared"
74
79
 
75
80
# Restore backup
76
81
stop_server
83
88
start_server --innodb_file_per_table
84
89
 
85
90
vlog "Checking checksums"
86
 
checksum_b=`checksum_table incremental_sample test`
87
 
 
88
 
if [ "$checksum_a" != "$checksum_b"  ]
89
 
then 
90
 
        vlog "Checksums are not equal"
 
91
checksum_test_b=`checksum_table incremental_sample test`
 
92
checksum_t2_b=`checksum_table incremental_sample t2`
 
93
 
 
94
if [ "$checksum_test_a" != "$checksum_test_b"  ]
 
95
then 
 
96
        vlog "Checksums of table 'test' are not equal"
 
97
        exit -1
 
98
fi
 
99
 
 
100
if [ "$checksum_t2_a" != "$checksum_t2_b"  ]
 
101
then 
 
102
        vlog "Checksums of table 't2' are not equal"
91
103
        exit -1
92
104
fi
93
105