~percona-core/percona-xtrabackup/release-2.0.7

« back to all changes in this revision

Viewing changes to test/t/remote_tablespaces.sh

  • Committer: Alexey Kopytov
  • Date: 2013-04-28 05:28:35 UTC
  • mfrom: (533.1.2 2.0)
  • Revision ID: akopytov@gmail.com-20130428052835-aadtc5yxcbadcmbj
Manual merge of lp:~akopytov/percona-xtrabackup/support-remote-tablespaces-2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
########################################################################
 
2
# Test remote tablespaces in InnoDB 5.6
 
3
########################################################################
 
4
 
 
5
. inc/common.sh
 
6
 
 
7
if [ ${MYSQL_VERSION:0:3} != "5.6" ]
 
8
then
 
9
    echo "Requires a 5.6 server" > $SKIPPED_REASON
 
10
    exit $SKIPPED_EXIT_CODE
 
11
fi
 
12
 
 
13
start_server --innodb_file_per_table
 
14
 
 
15
remote_dir=$TEST_BASEDIR/var1/remote_dir
 
16
 
 
17
$MYSQL $MYSQL_ARGS test <<EOF
 
18
CREATE TABLE t(id INT AUTO_INCREMENT PRIMARY KEY, c INT)
 
19
  DATA DIRECTORY = '$remote_dir' ENGINE=InnoDB;
 
20
INSERT INTO t(c) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
 
21
EOF
 
22
 
 
23
# Generate some log data, as we also want to test recovery of remote tablespaces
 
24
for ((i=0; i<12; i++))
 
25
do
 
26
    $MYSQL $MYSQL_ARGS test <<EOF
 
27
      INSERT INTO t(c) SELECT c FROM t;
 
28
EOF
 
29
done
 
30
 
 
31
checksum_a=`checksum_table test t`
 
32
 
 
33
innobackupex --no-timestamp $topdir/backup
 
34
 
 
35
stop_server
 
36
 
 
37
rm -rf $mysql_datadir/*
 
38
 
 
39
innobackupex --apply-log $topdir/backup
 
40
innobackupex --copy-back $topdir/backup
 
41
 
 
42
start_server
 
43
 
 
44
checksum_b=`checksum_table test t`
 
45
 
 
46
vlog "Old checksum: $checksum_a"
 
47
vlog "New checksum: $checksum_b"
 
48
 
 
49
if [ "$checksum_a" != "$checksum_b"  ]
 
50
then
 
51
    vlog "Checksums do not match"
 
52
    exit -1
 
53
fi