mysql5/mysql-5.7.27/mysql-test/suite/binlog/t/binlog_incident.test

36 lines
1.4 KiB
Plaintext

# The purpose of this test is to provide a reference for how the
# incident log event is represented in the output from the mysqlbinlog
# program.
source include/have_log_bin.inc;
source include/have_innodb.inc;
# Test in this file is binlog format agnostic, thus no need
# to rerun it for every format.
--source include/have_binlog_format_row.inc
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 $MYSQLD_DATADIR= `select @@datadir`;
RESET MASTER;
let $start_pos= query_get_value("SHOW MASTER STATUS", Position, 1);
let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
CREATE TABLE t1(a INT, b INT);
CREATE USER u1@h;
--echo #
--echo # The partially failed GRANT statement causes to log an incident event.
--echo #
--error ER_PASSWORD_NO_MATCH
GRANT SELECT(a) ON t1 TO u1@h, u2@h;
DROP USER u1@h;
DROP TABLE t1;
exec $MYSQL_BINLOG --start-position=$start_pos $MYSQLD_DATADIR/$master_binlog >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
--disable_query_log
eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
--enable_query_log
remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;