| 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 |
# Dynamic loading of Example does not work on Windows currently. |
| 12 |
--source include/not_windows.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 |
INSTALL PLUGIN example SONAME 'ha_example.so'; |
| 23 |
--echo Get binlog position after install plugin. |
| 24 |
let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1); |
| 25 |
--echo Compute the difference of the binlog positions. |
| 26 |
--echo Should be zero as install plugin should not be replicated. |
| 27 |
--disable_query_log |
| 28 |
eval SELECT $after_pos - $before_pos AS Delta; |
| 29 |
--enable_query_log |
| 30 |
--echo Verify that example engine is installed. |
| 31 |
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE'; |
| 32 |
# Wait for slave to catch up with master. |
| 33 |
--source include/sync_slave_sql_with_master.inc |
| 34 |
# |
| 35 |
--echo connection slave: Verify that example engine is not installed. |
| 36 |
connection slave; |
| 37 |
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE'; |
| 38 |
# |
| 39 |
--echo connection master: Uninstall example engine. |
| 40 |
connection master; |
| 41 |
--echo Get binlog position before uninstall plugin. |
| 42 |
let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1); |
| 43 |
UNINSTALL PLUGIN example; |
| 44 |
--echo Get binlog position after uninstall plugin. |
| 45 |
let $after_pos = query_get_value("SHOW MASTER STATUS", Position, 1); |
| 46 |
--echo Compute the difference of the binlog positions. |
| 47 |
--echo Should be zero as uninstall plugin should not be replicated. |
| 48 |
--disable_query_log |
| 49 |
eval SELECT $after_pos - $before_pos AS Delta; |
| 50 |
--enable_query_log |
| 51 |
--echo Verify that example engine is not installed. |
| 52 |
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE'; |
| 53 |
# Wait for slave to catch up with master. |
| 54 |
--source include/sync_slave_sql_with_master.inc |
| 55 |
# |
| 56 |
# Cleanup |
| 57 |
--source include/rpl_end.inc |
| 58 |
--echo End of test |