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; DROP DATABASE IF EXISTS auto_test_remote; CREATE DATABASE auto_test_remote; USE auto_test_remote; connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; CREATE DATABASE auto_test_remote2; USE auto_test_remote2; test select 1 connection master_1; SELECT 1; 1 1 with partition test connection master_1; CREATE TABLE ta_l2 ( a INT, b CHAR(1), c DATETIME, PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 0 SELECT COUNT(*) FROM ta_l2; COUNT(*) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 2 SELECT MAX(a) FROM ta_l2; MAX(a) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 4 SELECT MIN(a) FROM ta_l2; MIN(a) 1 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 6 SELECT MAX(a) FROM ta_l2 WHERE a < 5; MAX(a) 4 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 8 SELECT MIN(a) FROM ta_l2 WHERE a > 1; MIN(a) 2 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 10 deinit connection master_1; DROP DATABASE IF EXISTS auto_test_local; connection child2_1; DROP DATABASE IF EXISTS auto_test_remote; connection child2_2; DROP DATABASE IF EXISTS auto_test_remote2; for master_1 for child2 child2_1 child2_2 child2_3 for child3 child3_1 child3_2 child3_3 end of test