summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_plugin_load.test
blob: 100683922ad44f0b5631ec10583953d76680947d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Bug#35807 - INSTALL PLUGIN replicates row-based, but not stmt-based
#
# The test verifies that INSTALL PLUGIN and UNINSTALL PLUGIN
# work with replication.
#
# The test tries to install and uninstall a plugin on master,
# and verifies that it does not affect the slave,
# and that it does not add anything to the binlog.

--source include/not_embedded.inc
--source include/have_log_bin.inc
# Dynamic loading of Example does not work on Windows currently.
--source include/not_windows.inc
--source include/have_example_plugin.inc

# Initialize replication.
--source include/master-slave.inc
--echo Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
--echo Get binlog position before install plugin.
let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
--echo Install example engine.
INSTALL PLUGIN example SONAME 'ha_example.so';
--echo Get binlog position after install plugin.
let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
--echo Compute the difference of the  binlog positions.
--echo Should be zero as install plugin should not be replicated.
--disable_query_log
eval SELECT $after_pos - $before_pos AS Delta;
--enable_query_log
--echo Verify that example engine is installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
# Wait for slave to catch up with master.
sync_slave_with_master;
#
    --echo connection slave: Verify that example engine is not installed.
    connection slave;
    SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
#
--echo connection master: Uninstall example engine.
connection master;
--echo Get binlog position before uninstall plugin.
let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
UNINSTALL PLUGIN example;
--echo Get binlog position after uninstall plugin.
let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
--echo Compute the difference of the  binlog positions.
--echo Should be zero as uninstall plugin should not be replicated.
--disable_query_log
eval SELECT $after_pos - $before_pos AS Delta;
--enable_query_log
--echo Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
# Wait for slave to catch up with master.
sync_slave_with_master;
#
# Cleanup
--source include/master-slave-end.inc
--echo End of test