Current Path : /home/usr.opt/mysql57/mysql-test/suite/binlog/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/binlog/t/binlog_xa_modify_gtid_executed_explicitly.test |
# ==== Purpose ==== # # Verify that we do not allow users to modify the mysql.gtid_executed # table explicitly by a XA transaction. # # ==== Implementation ==== # # - Start a XA transaction and modify the mysql.gtid_executed # table explicitly. # - Check that the ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE error is caused. # - Check that users can not modify mysql.gtid_executed table explicitly. # # ==== References ==== # # Bug#21452916 SILENT FAILURE TO START IF MYSQL.GTIDS_EXECUTED GETS HA_ERR_LOCK_WAIT_TIMEOUT # --source include/have_binlog_format_row.inc --source include/have_log_bin.inc --source include/have_gtid.inc --let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` CREATE TABLE t1 (a INT); --echo # --echo # Verify that inserting gtid into mysql.gtid_executed table --echo # explicitly by a XA transaction causes an error. --echo # XA START '1'; INSERT INTO t1 VALUES(1); --error ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE INSERT INTO mysql.gtid_executed VALUES("aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916", 1, 1); XA END '1'; XA PREPARE '1'; XA COMMIT '1'; FLUSH LOGS; --echo # --echo # Verify that users can not insert gtid into mysql.gtid_executed --echo # table explicitly by a XA transaction. --echo # --let $assert_text= Table mysql.gtid_executed must not contain row with source_uuid=aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916 --let $assert_cond= "[SELECT * FROM mysql.gtid_executed WHERE source_uuid="aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916"]" = "" --source include/assert.inc --echo # --echo # Verify that updating mysql.gtid_executed table --echo # explicitly by a XA transaction causes an error. --echo # XA START '1'; INSERT INTO t1 VALUES(2); --error ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE UPDATE mysql.gtid_executed SET source_uuid = "aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916" WHERE source_uuid = '$master_uuid'; XA END '1'; XA PREPARE '1'; XA COMMIT '1'; --echo # --echo # Verify that users can not update mysql.gtid_executed --echo # table explicitly by a XA transaction. --echo # --let $assert_text= Table mysql.gtid_executed must not contain row with source_uuid=aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916 --let $assert_cond= "[SELECT * FROM mysql.gtid_executed WHERE source_uuid="aaaaaaaa-aaaa-aaaa-aaaa-bug#21452916"]" = "" --source include/assert.inc --echo # --echo # Verify that deleting from mysql.gtid_executed table --echo # explicitly by a XA transaction causes an error. --echo # XA START '1'; INSERT INTO t1 VALUES(3); --error ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE DELETE FROM mysql.gtid_executed WHERE source_uuid = '$master_uuid'; XA END '1'; XA PREPARE '1'; XA COMMIT '1'; --echo # --echo # Verify that users can not delete from mysql.gtid_executed --echo # table explicitly by a XA transaction. --echo # --let $assert_text= Table mysql.gtid_executed must contain GTID(s) with source_uuid = master_uuid --let $assert_cond= "[SELECT COUNT(*) FROM mysql.gtid_executed WHERE source_uuid = "$master_uuid"]" > 0 --source include/assert.inc DROP TABLE t1;