1for master_1 2for child2 3child2_1 4child2_2 5child2_3 6for child3 7child3_1 8child3_2 9child3_3 10 11drop and create databases 12connection master_1; 13DROP DATABASE IF EXISTS auto_test_local; 14CREATE DATABASE auto_test_local; 15USE auto_test_local; 16connection child2_1; 17SET @old_log_output = @@global.log_output; 18SET GLOBAL log_output = 'TABLE,FILE'; 19DROP DATABASE IF EXISTS auto_test_remote; 20CREATE DATABASE auto_test_remote; 21USE auto_test_remote; 22 23test select 1 24connection master_1; 25SELECT 1; 261 271 28connection child2_1; 29SELECT 1; 301 311 32 33create table and insert 34connection child2_1; 35CHILD2_1_DROP_TABLES 36CHILD2_1_DROP_TABLES6 37CHILD2_1_DROP_TABLES4 38CHILD2_1_DROP_TABLES3 39CHILD2_1_CREATE_TABLES 40CHILD2_1_CREATE_TABLES6 41CHILD2_1_CREATE_TABLES4 42CHILD2_1_CREATE_TABLES3 43TRUNCATE TABLE mysql.general_log; 44connection master_1; 45DROP TABLE IF EXISTS tbl_a; 46CREATE TABLE tbl_a ( 47a INT DEFAULT 10, 48b CHAR(1) DEFAULT 'c', 49c DATETIME DEFAULT '1999-10-10 10:10:10', 50KEY idx0(a), 51KEY idx1(b) 52) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 53CREATE TABLE tbl_b ( 54a INT DEFAULT 10, 55b CHAR(1) DEFAULT 'c', 56c DATETIME DEFAULT '1999-10-10 10:10:10' 57) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1 58CREATE TABLE tbl_c ( 59a INT AUTO_INCREMENT, 60b CHAR(1) DEFAULT 'c', 61c DATETIME DEFAULT '1999-10-10 10:10:10', 62KEY idx0(a), 63KEY idx1(b), 64KEY idx2(c) 65) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 66CREATE TABLE tbl_d ( 67a INT DEFAULT 10, 68b CHAR(1) DEFAULT 'c', 69c DATETIME DEFAULT '1999-10-10 10:10:10' 70) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1 71insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); 72insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); 73insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); 74insert into tbl_d 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'); 75 76select test 77connection child2_1; 78TRUNCATE TABLE mysql.general_log; 79connection master_1; 80SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; 81a b c a 82NULL NULL NULL 5 83NULL d 2000-01-04 00:00:00 4 84NULL c 2000-01-03 00:00:00 3 852 b 2000-01-02 00:00:00 2 861 a 2000-01-01 00:00:00 1 87connection child2_1; 88SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; 89argument 90select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join `auto_test_remote`.`ta_r_auto_inc` t2 on ((t2.`b` = t3.`b`) and (t3.`b` is not null)) left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) where 1 order by t3.`a` desc 91SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' 92SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_r ORDER BY a; 93a b date_format(c, '%Y-%m-%d %H:%i:%s') 941 a 2000-01-01 00:00:00 952 b 2000-01-02 00:00:00 96 97deinit 98connection master_1; 99DROP DATABASE IF EXISTS auto_test_local; 100connection child2_1; 101DROP DATABASE IF EXISTS auto_test_remote; 102SET GLOBAL log_output = @old_log_output; 103for master_1 104for child2 105child2_1 106child2_2 107child2_3 108for child3 109child3_1 110child3_2 111child3_3 112 113end of test 114