Current Path : /home/usr.opt/mysql57/mysql-test/suite/rpl/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/rpl/t/rpl_pump.test |
# ==== Purpose ==== # # Create a backup from a master , which at later point can be restored # successfully on slave. # # 1. Perform some DDL/DML operations on a master # 2. Create a backup from the member using mysqlpump # 3. Verify if that backup can be later restored successfully on a 2nd server # 4. See if that @@GLOBAL.GTID_EXECUTED is same on both servers. # 5. Set up replication.Perform some DDL/DML operations on the master. # 6. Cleanup # # ==== Related Bugs and Worklogs ==== # # Bug #23748432 MYSQLPUMP FULL LOGICAL BACKUPS UNUSABLE WITH GTID REPLICATION # --let $rpl_skip_start_slave= 1 --source include/have_gtid.inc # test is agnostic to binlog_format --source include/have_binlog_format_row.inc --source include/master-slave.inc # Create a table and insert data into it. CREATE DATABASE db; USE db; CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (0); INSERT INTO t1 VALUES (1); UPDATE t1 SET c1=2 WHERE c1=0; SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1'; INSERT INTO t1 VALUES (3); SET GTID_NEXT= 'AUTOMATIC'; --let $master_executed = `SELECT @@GLOBAL.GTID_EXECUTED` # Create a backup using mysqlpump --let $server1_backup_file= backup_server1.sql # Use mysqlpump client to get a dump of server1 --exec $MYSQL_PUMP --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --all-databases --exclude-databases=mysql,mtr > $server_1_datadir/$server1_backup_file # Restore the backup onto a 2nd server --echo --source include/rpl_connection_slave.inc --exec $MYSQL --user=root --host=127.0.0.1 --port=$SLAVE_MYPORT < $server_1_datadir/$server1_backup_file # See if the data has been properly restored on server2 --let $assert_cond = "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_executed" --let $assert_text = 'gtid_executed should be the same on master and slave' --source include/assert.inc --echo --let $diff_tables= master:db.t1, slave:db.t1 --source include/diff_tables.inc # Start replication on slave --echo --source include/start_slave.inc # Drop table --echo --source include/rpl_connection_master.inc DROP DATABASE db; --remove_file $server_1_datadir/$server1_backup_file --source include/rpl_end.inc