Commit 14ef6a2c authored by Andrei Elkin's avatar Andrei Elkin

MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to ...

Testing is extended with a block added up to binlog_grant.
parent 12b7d5dc
......@@ -124,5 +124,29 @@ disconnect user1;
connection default;
DROP USER user1@localhost;
#
# MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to
# gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
#
# Test combinations of BINLOG REPLAY guarded features which typically
# arise in mysqlbinlog output replay on server.
#
CREATE USER user1@localhost;
GRANT BINLOG REPLAY ON *.* TO user1@localhost;
RESET MASTER;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
connect user1,localhost,user1,,;
RENAME TABLE t1 to t2;
connection default;
REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
call mtr.add_suppression("Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation");
# Privilege errors are expected now:
connection user1;
connection default;
include/diff_tables.inc [t1,t2]
# Test cleanup
DROP TABLE t2,t1;
DROP USER user1@localhost;
#
# End of 10.5 test
#
......@@ -172,6 +172,43 @@ SHOW BINLOG EVENTS;
connection default;
DROP USER user1@localhost;
--echo #
--echo # MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to
--echo # gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
--echo #
--echo # Test combinations of BINLOG REPLAY guarded features which typically
--echo # arise in mysqlbinlog output replay on server.
--echo #
CREATE USER user1@localhost;
GRANT BINLOG REPLAY ON *.* TO user1@localhost;
RESET MASTER;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
--connect(user1,localhost,user1,,)
# Genuine mysqlbinlog output
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
RENAME TABLE t1 to t2;
--exec $MYSQL --user=user1 test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
--connection default
REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
call mtr.add_suppression("Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation");
--echo # Privilege errors are expected now:
--connection user1
--error 1
--exec $MYSQL --user=user1 test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
--connection default
--let $diff_tables=t1,t2
--source include/diff_tables.inc
--echo # Test cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
DROP TABLE t2,t1;
DROP USER user1@localhost;
--echo #
--echo # End of 10.5 test
--echo #
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment