1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Make Replication filter settings dynamic.

Make the slave options --replicate-* dynamic variables so that these
options can be changed dynamically while the server is running,
which enables users to modify replication filtering rules without
having to stop and restart the server.

This is accomplished by just requiring that the slave threads are
stopped when these options are set dynamically. Since filtering
rules are only used by the SQL slave thread, setting them while the
thread is not running avoids the need for locking.
This commit is contained in:
Davi Arnaut
2012-03-19 15:00:23 -07:00
committed by unknown
parent 7789f3d567
commit 9584cbe7fc
23 changed files with 1483 additions and 18 deletions

View File

@ -0,0 +1,39 @@
--source include/not_embedded.inc
--echo #
--echo # Basic testing of replicate_do_db.
--echo #
SET @save_replicate_do_db = @@GLOBAL.replicate_do_db;
SELECT @save_replicate_do_db;
--echo # Scope.
--error ER_GLOBAL_VARIABLE
SET @@SESSION.replicate_do_db = "";
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.replicate_do_db;
--echo # Incorrect type.
--error ER_WRONG_TYPE_FOR_VAR
SET @@GLOBAL.replicate_do_db=1;
--error ER_WRONG_TYPE_FOR_VAR
SET @@GLOBAL.replicate_do_db=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET @@GLOBAL.replicate_do_db=1e1;
--echo # Argument syntax.
SET @@GLOBAL.replicate_do_db="db1,,,,,db3";
SELECT @@GLOBAL.replicate_do_db;
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='replicate_do_db';
SET @@GLOBAL.replicate_do_db="db1,,,db2,,,db3";
SELECT @@GLOBAL.replicate_do_db;
SET @@GLOBAL.replicate_do_db="";
SELECT @@GLOBAL.replicate_do_db;
--echo # Cleanup.
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;