Debian Codegraph @

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

raw
1 #
2 # Bug#35807 - INSTALL PLUGIN replicates row-based, but not stmt-based
3 #
4 # The test verifies that INSTALL PLUGIN and UNINSTALL PLUGIN
5 # work with replication.
6 #
7 # The test tries to install and uninstall a plugin on master,
8 # and verifies that it does not affect the slave,
9 # and that it does not add anything to the binlog.
10
11 --source include/not_embedded.inc
12 --source include/have_log_bin.inc
13 --source include/have_example_plugin.inc
14
15 # Initialize replication.
16 --source include/master-slave.inc
17 --echo Verify that example engine is not installed.
18 SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
19 --echo Get binlog position before install plugin.
20 let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
21 --echo Install example engine.
22 --replace_regex /\.dll/.so/
23 eval INSTALL PLUGIN example SONAME '$HA_EXAMPLE_SO';
24 --echo Get binlog position after install plugin.
25 let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
26 --echo Compute the difference of the binlog positions.
27 --echo Should be zero as install plugin should not be replicated.
28 --disable_query_log
29 eval SELECT $after_pos - $before_pos AS Delta;
30 --enable_query_log
31 --echo Verify that example engine is installed.
32 SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
33 # Wait for slave to catch up with master.
34 sync_slave_with_master;
35 #
36 --echo Verify that example engine is not installed.
37 connection slave;
38 SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
39 #
40 --echo Uninstall example engine.
41 connection master;
42 --echo Get binlog position before uninstall plugin.
43 let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
44 UNINSTALL PLUGIN example;
45 --echo Get binlog position after uninstall plugin.
46 let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
47 --echo Compute the difference of the binlog positions.
48 --echo Should be zero as uninstall plugin should not be replicated.
49 --disable_query_log
50 eval SELECT $after_pos - $before_pos AS Delta;
51 --enable_query_log
52 --echo Verify that example engine is not installed.
53 SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
54 # Wait for slave to catch up with master.
55 sync_slave_with_master;
56 #
57 # Cleanup
58 --source include/rpl_end.inc
59 --echo End of test