DROP DATABASE IF EXISTS bup_snapshot; CREATE DATABASE bup_snapshot; CREATE TABLE bup_snapshot.t1 (word CHAR(30)) ENGINE=FALCON; INSERT INTO bup_snapshot.t1 VALUES ("01 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("02 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("03 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("04 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("05 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("06 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("07 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("08 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("09 Some data: FALCON"); INSERT INTO bup_snapshot.t1 VALUES ("10 Some data: FALCON"); CREATE TABLE bup_snapshot.t2 (a int) ENGINE=MEMORY; INSERT INTO bup_snapshot.t2 VALUES (1), (2), (3), (4), (5); CREATE TABLE bup_snapshot.t3 (word CHAR(30)) ENGINE=INNODB; INSERT INTO bup_snapshot.t3 VALUES ("01 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("02 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("03 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("04 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("05 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("06 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("07 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("08 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("09 Some data: INNODB"); INSERT INTO bup_snapshot.t3 VALUES ("10 Some data: INNODB"); con1: Show that the new data doesn't exist before backup. SELECT * FROM bup_snapshot.t1 WHERE word LIKE 'FALCON%'; word SELECT * FROM bup_snapshot.t3 WHERE word LIKE 'INNODB%'; word SELECT COUNT(*) FROM bup_snapshot.t1; COUNT(*) 10 SELECT COUNT(*) FROM bup_snapshot.t2; COUNT(*) 5 SELECT COUNT(*) FROM bup_snapshot.t3; COUNT(*) 10 con2: Getting lock on driver. SELECT get_lock("backup_cs_locked", 100); get_lock("backup_cs_locked", 100) 1 con1: Backing up database. Spawn this and continue... BACKUP DATABASE bup_snapshot TO "bup_snapshot.bak"; con2: Wait until backup pauses then insert new data. INSERT INTO bup_snapshot.t1 VALUES("FALCON - Dave Mathews"); INSERT INTO bup_snapshot.t1 VALUES("FALCON - Yes"); INSERT INTO bup_snapshot.t1 VALUES("FALCON - Jethro Tull"); DELETE FROM bup_snapshot.t1 WHERE word LIKE '0%'; INSERT INTO bup_snapshot.t3 VALUES("INNODB - Dave Mathews"); INSERT INTO bup_snapshot.t3 VALUES("INNODB - Yes"); INSERT INTO bup_snapshot.t3 VALUES("INNODB - Jethro Tull"); DELETE FROM bup_snapshot.t3 WHERE word LIKE '10%'; con2: Showing the data after inserts. SELECT * FROM bup_snapshot.t1 WHERE word LIKE 'FALCON%'; word FALCON - Dave Mathews FALCON - Yes FALCON - Jethro Tull SELECT COUNT(*) FROM bup_snapshot.t1; COUNT(*) 4 SELECT * FROM bup_snapshot.t3 WHERE word LIKE 'INNODB%'; word INNODB - Dave Mathews INNODB - Yes INNODB - Jethro Tull SELECT COUNT(*) FROM bup_snapshot.t3; COUNT(*) 12 con2: Release lock on driver. SELECT release_lock("backup_cs_locked"); release_lock("backup_cs_locked") 1 Backup Summary header = 33 bytes meta-data = 277 bytes data = 590 bytes -------------- total 900 bytes con1: Dropping the database DROP TABLE bup_snapshot.t1; DROP TABLE bup_snapshot.t3; con1: Restoring the database RESTORE FROM "bup_snapshot.bak"; Restore Summary header = 33 bytes meta-data = 277 bytes data = 590 bytes -------------- total 900 bytes con1: Showing the data (no new data should be here). SELECT * FROM bup_snapshot.t1 WHERE word LIKE 'FALCON%'; word SELECT * FROM bup_snapshot.t3 WHERE word LIKE 'INNODB%'; word SELECT COUNT(*) FROM bup_snapshot.t1; COUNT(*) 10 SELECT COUNT(*) FROM bup_snapshot.t2; COUNT(*) 5 SELECT COUNT(*) FROM bup_snapshot.t3; COUNT(*) 10 con2: Getting lock on driver. SELECT get_lock("backup_cs_reading", 100); get_lock("backup_cs_reading", 100) 1 con1: Backing up database. Spawn this and continue... BACKUP DATABASE bup_snapshot TO "bup_snapshot.bak"; con2: Wait until backup pauses then insert new data. INSERT INTO bup_snapshot.t1 VALUES("FALCON - Dave Mathews"); INSERT INTO bup_snapshot.t1 VALUES("FALCON - Yes"); INSERT INTO bup_snapshot.t1 VALUES("FALCON - Jethro Tull"); DELETE FROM bup_snapshot.t1 WHERE word LIKE '0%'; INSERT INTO bup_snapshot.t3 VALUES("INNODB - Dave Mathews"); INSERT INTO bup_snapshot.t3 VALUES("INNODB - Yes"); INSERT INTO bup_snapshot.t3 VALUES("INNODB - Jethro Tull"); DELETE FROM bup_snapshot.t3 WHERE word LIKE '10%'; con2: Showing the data after inserts. SELECT * FROM bup_snapshot.t1 WHERE word LIKE 'FALCON%'; word FALCON - Dave Mathews FALCON - Yes FALCON - Jethro Tull SELECT * FROM bup_snapshot.t3 WHERE word LIKE 'INNODB%'; word INNODB - Dave Mathews INNODB - Yes INNODB - Jethro Tull SELECT COUNT(*) FROM bup_snapshot.t1; COUNT(*) 4 SELECT COUNT(*) FROM bup_snapshot.t3; COUNT(*) 12 con2: Release lock on driver. SELECT release_lock("backup_cs_reading"); release_lock("backup_cs_reading") 1 Backup Summary header = 33 bytes meta-data = 277 bytes data = 590 bytes -------------- total 900 bytes con1: Dropping the database DROP TABLE bup_snapshot.t1; con1: Restoring the database RESTORE FROM "bup_snapshot.bak"; Restore Summary header = 33 bytes meta-data = 277 bytes data = 590 bytes -------------- total 900 bytes con1: Showing the data (no new data should be here). SELECT * FROM bup_snapshot.t1 WHERE word LIKE 'FALCON%'; word SELECT * FROM bup_snapshot.t3 WHERE word LIKE 'INNODB%'; word SELECT COUNT(*) FROM bup_snapshot.t1; COUNT(*) 10 SELECT COUNT(*) FROM bup_snapshot.t2; COUNT(*) 5 SELECT COUNT(*) FROM bup_snapshot.t3; COUNT(*) 10 DROP DATABASE bup_snapshot;