for master_1 for child2 child2_1 child2_2 child2_3 for child3 child3_1 child3_2 child3_3 drop and create databases connection master_1; DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; connection child2_1; SET @old_log_output = @@global.log_output; SET GLOBAL log_output = 'TABLE,FILE'; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; test select 1 connection master_1; SELECT 1; 1 1 connection child2_1; SELECT 1; 1 1 create table and insert connection child2_1; CHILD2_1_DROP_TABLES CHILD2_1_DROP_TABLES6 CHILD2_1_DROP_TABLES5 CHILD2_1_CREATE_TABLES CHILD2_1_CREATE_TABLES6 CHILD2_1_CREATE_TABLES5 TRUNCATE TABLE mysql.general_log; connection master_1; DROP TABLE IF EXISTS tbl_a; CREATE TABLE tbl_a ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10', PRIMARY KEY(a), KEY idx1(b) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 CREATE TABLE tbl_b ( a INT DEFAULT 10, b CHAR(1) DEFAULT 'c', c DATETIME DEFAULT '1999-10-10 10:10:10' ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1 CREATE TABLE tbl_c ( a INT AUTO_INCREMENT, b INT DEFAULT 10, c INT DEFAULT 11, PRIMARY KEY(a), KEY idx1(b), KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); select test connection child2_1; TRUNCATE TABLE mysql.general_log; connection master_1; SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; a b c 5 50 500 4 40 400 3 30 300 2 20 200 1 10 100 connection child2_1; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; argument select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r_int` t2 left join (`auto_test_remote`.`ta_r` t0 join `auto_test_remote`.`ta_r_3` t1) on ((t0.`a` = t2.`a`) and (t1.`a` = t2.`a`)) where 1 order by t0.`b` desc SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2000-01-01 00:00:00 2 b 2000-01-02 00:00:00 3 c 2000-01-03 00:00:00 4 d 2000-01-04 00:00:00 5 e 2000-01-05 00:00:00 deinit connection master_1; DROP DATABASE IF EXISTS auto_test_local; connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; SET GLOBAL log_output = @old_log_output; for master_1 for child2 child2_1 child2_2 child2_3 for child3 child3_1 child3_2 child3_3 end of test