source include/master-slave.inc; -- source include/have_innodb.inc -- source include/not_embedded.inc -- source include/have_binlog_format_mixed_or_statement.inc let $VERSION=`select version()`; # Bug #21975: grant/revoke statements in transaction # used to disappear from binlog upon rallback. # Now GRANT/REVOKE do implicitly commit # transaction create database d1; use d1; create table t (s1 int) engine=innodb; set @@autocommit=0; start transaction; insert into t values (1); grant select on t to x@y; let $wait_binlog_event= grant select; source include/wait_for_binlog_event.inc; # # There is no active transaction here # rollback; show grants for x@y; start transaction; insert into t values (2); revoke select on t from x@y; let $wait_binlog_event= revoke select; source include/wait_for_binlog_event.inc; # # There is no active transaction here # commit; select * from t; show grants for x@y; drop user x@y; drop database d1; # # Bug#23623115: PROXY GRANTS ARE NOT PROPERLY LOGGED IN BINLOG # --let $rpl_connection_name= master --source include/rpl_connection.inc CREATE USER foo@localhost IDENTIFIED WITH 'mysql_native_password'; CREATE USER bar@localhost IDENTIFIED WITH 'mysql_native_password'; --let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1) --let $query= GRANT PROXY ON foo@localhost TO bar@localhost IDENTIFIED BY '123'; --let $binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1) --eval $query --let $row_number = 1 --let $gtid_mode=`select @@global.gtid_mode` if ($gtid_mode == 'ON') { --let $row_number = 2 } --let $logged_query= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_position, Info, $row_number) --let $assert_cond= `SELECT "$logged_query" LIKE "%GRANT PROXY%"` --let $assert_text= Assert that the query logged is indeed the GRANT PROXY one --source include/assert.inc SHOW GRANTS FOR bar@localhost; --source include/sync_slave_sql_with_master.inc --let $rpl_connection_name= slave --source include/rpl_connection.inc SHOW GRANTS FOR bar@localhost; --let $rpl_connection_name= master --source include/rpl_connection.inc DROP USER foo@localhost; DROP USER bar@localhost; --source include/sync_slave_sql_with_master.inc --source include/rpl_end.inc