Description:
* Create databases, tables and load some data
* Perform backup using innobackup
* Perform some data manipulation operations in db1.t1 and db2.t2
* Execute innobackup --apply-logs
* Shutdown the server
* Perform restore using innobackup --copy-back option. Restart the server and we can notice that all the modified contents after backup is overwritten by restore. There should be a warning message issued when --copy-back is performed.
This will give users a caution to take backup after some additional data manipulation operations.
How to repeat:
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE TABLE db1.t1(id INT)ENGINE=INNODB;
CREATE TABLE db2.t2(a CHAR(10))ENGINE=INNODB;
INSERT INTO db1.t1 VALUES(1),(2),(3),(4);
INSERT INTO db2.t2 VALUES('a'),('b'),('c'),('d');
SELECT * FROM db1.t1;
SELECT * FROM db2.t2;
perl innobackup hema-inno.cnf mysql-test/backup/ --socket=/export/home2/tmp/mysql-5.1-ihb/mysql-test/var/tmp/mysqld.1.sock --user=root --ibbackup=/export/home2/tmp/mysql-5.1-ihb/ibbackup
INSERT INTO db1.t1 VALUES(5),(6);
DELETE FROM db2.t2 WHERE a='d';
perl innobackup --apply-log hema-inno.cnf /export/home2/tmp/mysql-5.1-ihb/mysql-test/backup/2010-04-21_23-35-15/ --ibbackup=/export/home2/tmp/mysql-5.1-ihb/ibbackup
Shutdown mysqld server
Perform copy-back
./innobackup --copy-back hema-inno.cnf /export/home2/tmp/mysql-5.1-ihb/mysql-test/backup/2010-04-21_23-35-15/
Now start the server,
Check the data contents in db1.t1 and db2.t2
SELECT * FROM db1.t1;
id
1
2
3
4
SELECT * FROM db2.t2;
a
a
b
c
d
Note that although we got all the backed up contents for db1 and db2, there was no warning message about the overwriting of the contents.