Merge lp:~akopytov/percona-xtrabackup/bug817132-1.6 into lp:percona-xtrabackup/1.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 281
Proposed branch: lp:~akopytov/percona-xtrabackup/bug817132-1.6
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 59 lines (+43/-1)
2 files modified
innobackupex (+1/-1)
test/t/bug817132.sh (+42/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug817132-1.6
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+75224@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2011-06-11 08:00:46 +0000
3+++ innobackupex 2011-09-13 17:06:25 +0000
4@@ -215,7 +215,7 @@
5
6 # initialize global variables and perform some checks
7 if ($option_copy_back) {
8- $option_ibbackup_binary = 'xtrabackup_51' if (! $option_ibbackup_binary);
9+ $option_ibbackup_binary = 'xtrabackup' if ($option_ibbackup_binary eq 'autodetect');
10 } elsif ($option_apply_log) {
11 # Read XtraBackup version from backup dir
12 if (-e "$backup_dir/$xtrabackup_binary_file") {
13
14=== added file 'test/t/bug817132.sh'
15--- test/t/bug817132.sh 1970-01-01 00:00:00 +0000
16+++ test/t/bug817132.sh 2011-09-13 17:06:25 +0000
17@@ -0,0 +1,42 @@
18+########################################################################
19+# Bug #817132: innobackupex copy-back doesn't work without ibbackup
20+########################################################################
21+
22+. inc/common.sh
23+
24+# innobackupex --copy-back without explicit --ibbackup specification
25+# defaults to 'xtrabackup'. So any build configurations other than xtradb51
26+# would fail in Jenkins.
27+if [ "`basename $XB_BIN`" != "xtrabackup" ]; then
28+ echo "Requires xtradb51" > $SKIPPED_REASON
29+ exit $SKIPPED_EXIT_CODE
30+fi
31+
32+init
33+run_mysqld
34+load_dbase_schema sakila
35+load_dbase_data sakila
36+
37+mkdir -p $topdir/backup
38+innobackupex $topdir/backup > $OUTFILE 2>&1
39+backup_dir=`grep "innobackupex: Backup created in directory" $OUTFILE | awk -F\' '{ print $2}'`
40+vlog "Backup created in directory $backup_dir"
41+
42+stop_mysqld
43+# Remove datadir
44+rm -r $mysql_datadir
45+
46+# Restore sakila
47+vlog "Applying log"
48+innobackupex --apply-log $backup_dir >> $OUTFILE 2>&1
49+vlog "Restoring MySQL datadir"
50+mkdir -p $mysql_datadir
51+
52+# The following would fail before #817132 was fixed.
53+# Cannot use innobackupex here, because that would specify
54+# --ibbackup explicitly (see $IB_ARGS).
55+run_cmd $IB_BIN --defaults-file=$topdir/my.cnf --user=root --socket=$mysql_socket --copy-back $backup_dir >> $OUTFILE 2>&1
56+
57+run_mysqld
58+# Check sakila
59+run_cmd ${MYSQL} ${MYSQL_ARGS} -e "SELECT count(*) from actor" sakila

Subscribers

People subscribed via source and target branches