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_gtid_next_partially_failed_grant.test |
# ==== Purpose ==== # # Verify that a partially failed 'GRANT' statement does not save its gtid # into @@GLOBAL.GTID_EXECUTED and is not binlogged when binlog is enabled. # # ==== Implementation ==== # # 1) Execute a partially failed 'GRANT' statement. # 2) Verify that the partially failed statement does not save its gtid # into @@GLOBAL.GTID_EXECUTED, since it is not binlogged when binlog # is enabled. # 3) Execute above two steps for all different types of statements. # # ==== References ==== # # Bug#21686749 PARTIALLY FAILED DROP OR ACL STMT FAILS TO CONSUME GTID ON BINLOGLESS SLAVE # See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts.test # See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts_error.test # See mysql-test/suite/binlog/t/binlog_gtid_next_partially_failed_stmts.test # See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts_anonymous.test # # Test in this file is binlog format agnostic, thus no need # to rerun it for every format. --source include/have_binlog_format_row.inc --source include/have_gtid.inc # Make sure the test is repeatable RESET MASTER; call mtr.add_suppression("REVOKE/GRANT failed while storing table level and column level grants in the privilege tables. An incident event has been written to the binary log which will stop the slaves."); --let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` CREATE TABLE t1(a INT, b INT); CREATE USER u1@h; --echo # --echo # Verify that u1 is added into mysql.user. --echo # SELECT user FROM mysql.user WHERE user='u1'; --let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1) --error ER_PASSWORD_NO_MATCH GRANT SELECT(a) ON t1 TO u1@h, u2@h; --echo # --echo # The SELECT privilege on column a is granted to u1@h, --echo # which means that GRANT can be failed partially when --echo # granting an available privilege to both an existent --echo # user and a non-existent user. --echo # SELECT user, column_name, column_priv FROM mysql.columns_priv; --echo # --echo # Verify that the partially failed GRANT statement is not binlogged, --echo # and it causes to log an incident event with an unique gtid, which --echo # is saved into @@GLOBAL.GTID_EXECUTED. --echo # --let $keep_gtid_events= 1 --let $binlog_start= $saved_master_pos --source include/show_binlog_events.inc --replace_result $master_uuid MASTER_UUID --let $assert_text= Generate MASTER_UUID:4 for the incident event and commit it into @@GLOBAL.GTID_EXECUTED --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-4" --source include/assert.inc # The incident event cteated by GRANT statement will cause a failure when # calling show_binlog_events.inc again. That is the reason we put the # GRANT statement in an independent test file. You can see the error when # executing the following three lines. #--let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1) #--let $binlog_start= $saved_master_pos #--source include/show_binlog_events.inc DROP USER u1@h; DROP TABLE t1;