403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/multi_source/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.test
#
# Test multi-source dynamically setting of replication filter
# "replicate_rewrite_db"
#
# This test ensures that setting a replica's replicate_rewrite_db works on a
# per-master basis. To ensure this, this test connects a replica to two
# different primary server instances. Each primary uses the same database
# name and table name. To ensure the data operations don't interfere with one
# another on the replica, it sets replicate_rewrite_db individually per
# connection to apply the events from each primary into a database specific to
# that connection.
#

--source include/not_embedded.inc
--source include/have_innodb.inc

--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)


--echo # Connect the slave (server_3) to two masters (server_1 and server_2)
--connection server_3
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval CHANGE MASTER 'm1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval CHANGE MASTER 'm2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';

--echo # Apply events from server_1 (m1) into m1_test
create database m1_test;
SET @@global.'m1'.replicate_rewrite_db='test->m1_test';

--echo # Apply events from server_2 (m2) into m2_test
create database m2_test;
SET @@global.'m2'.replicate_rewrite_db='test->m2_test';

start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
--source include/wait_for_slave_to_start.inc

--echo # Create test data for servers 1 and 2 with different data
--connection server_1
create table t (a int);
insert into t values (1);
insert into t values (2);
insert into t values (3);
--source include/save_master_gtid.inc
--connection server_3
--source include/sync_with_master_gtid.inc

--connection server_2
create table t (a int);
insert into t values (4);
insert into t values (5);
insert into t values (6);
--source include/save_master_gtid.inc
--connection server_3
--source include/sync_with_master_gtid.inc

--echo # Ensure the slave correctly replicates data from each master into its
--echo # respective database
--let $diff_tables=server_1:test.t,server_3:m1_test.t
--source include/diff_tables.inc

--let $diff_tables=server_2:test.t,server_3:m2_test.t
--source include/diff_tables.inc


--echo #
--echo # Cleanup

--connection server_1
DROP TABLE t;
--source include/save_master_gtid.inc
--connection server_3
--source include/sync_with_master_gtid.inc

--connection server_2
DROP TABLE t;
--source include/save_master_gtid.inc
--connection server_3
--source include/sync_with_master_gtid.inc

--connection server_3
stop all slaves;
SET default_master_connection = "m1";
--source include/wait_for_slave_to_stop.inc
SET default_master_connection = "m2";
--source include/wait_for_slave_to_stop.inc
RESET SLAVE ALL;
DROP DATABASE m1_test;
DROP DATABASE m2_test;

--echo # End of replicate_rewrite_db_dynamic.test

Youez - 2016 - github.com/yon3zu
LinuXploit