Debian Codegraph @

mysql-test/suite/rpl/t/rpl_slave_invalid_external_user.test

raw
1 # ==== Purpose ====
2 #
3 # Test verifies that when applier thread tries to access 'variable_name' of
4 # INFORMATION_SCHEMA.SESSION_VARIABLES table through triggers it successfully
5 # retrieves all the session variables.
6 #
7 # ==== Implementation ====
8 #
9 # Steps:
10 # 0 - Create two tables t1 and t2.
11 # 1 - Create a trigger such that it reads the names of all session variables
12 # from INFORMATION_SCHEMA.SESSION_VARIABLES table and populates one of the
13 # tables.
14 # 2 - Do a DML on master and wait for it to be replicated and ensure that
15 # slave is in sync with master and it is up and running.
16 #
17 # ==== References ====
18 #
19 # MDEV-14784: Slave crashes in show_status_array upon running a trigger with
20 # select from I_S
21
22 --source include/master-slave.inc
23 --source include/have_binlog_format_mixed.inc
24 --enable_connect_log
25 CREATE USER test_user@localhost;
26 SET PASSWORD FOR test_user@localhost = password('PWD');
27 GRANT ALL ON *.* TO test_user@localhost WITH GRANT OPTION;
28 connect(conn_test,localhost,test_user,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);
29
30 --connection conn_test
31 CREATE TABLE t1 (f1 INT);
32 CREATE TABLE t2 (f2 VARCHAR(64));
33 CREATE TRIGGER tr_before BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES;
34 CREATE DEFINER='root'@'localhost' TRIGGER tr_after AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT variable_name FROM INFORMATION_SCHEMA.SESSION_VARIABLES;
35
36 INSERT INTO t1 VALUES (1);
37 --disable_connect_log
38 # Cleanup
39 --connection master
40 DROP USER 'test_user'@'localhost';
41 DROP TABLE t1, t2;
42 --source include/rpl_end.inc