diff options
Diffstat (limited to 'storage/spider/mysql-test')
41 files changed, 2863 insertions, 32 deletions
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result index 9a8660ba79e..ede48906a84 100644 --- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result @@ -60,25 +60,25 @@ MAX(a) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 1 SELECT MIN(a) FROM ta_l; MIN(a) 1 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 2 SELECT MAX(a) FROM ta_l WHERE a < 5; MAX(a) 4 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 3 SELECT MIN(a) FROM ta_l WHERE a > 1; MIN(a) 2 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 4 deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result index 760b39e16d5..02cdc033a88 100644 --- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result +++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result @@ -44,31 +44,31 @@ COUNT(*) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +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 0 +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 0 +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 0 +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 0 +Spider_direct_aggregate 10 deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update.result b/storage/spider/mysql-test/spider/bg/r/direct_update.result index 74dae7aec2e..0e536d48617 100644 --- a/storage/spider/mysql-test/spider/bg/r/direct_update.result +++ b/storage/spider/mysql-test/spider/bg/r/direct_update.result @@ -48,6 +48,7 @@ direct_updating test connection master_1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -59,6 +60,7 @@ update all rows with function UPDATE ta_l SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -70,6 +72,7 @@ update by primary key UPDATE ta_l SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -81,6 +84,7 @@ update by a column without index UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -92,6 +96,7 @@ update by primary key with order and limit UPDATE ta_l SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -103,6 +108,7 @@ delete by primary key with order and limit DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -113,6 +119,7 @@ delete by a column without index DELETE FROM ta_l WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -122,6 +129,7 @@ delete by primary key DELETE FROM ta_l WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result index 6db7c01f563..7069cd72fda 100644 --- a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result +++ b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result @@ -38,6 +38,7 @@ PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -49,6 +50,7 @@ update all rows with function UPDATE ta_l2 SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -60,6 +62,7 @@ update by primary key UPDATE ta_l2 SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -71,6 +74,7 @@ update by a column without index UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 5 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -82,6 +86,7 @@ update by primary key with order and limit UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 6 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -93,6 +98,7 @@ delete by primary key with order and limit DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -103,6 +109,7 @@ delete by a column without index DELETE FROM ta_l2 WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -112,6 +119,7 @@ delete by primary key DELETE FROM ta_l2 WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result index f50c9822534..1db31ca9f95 100644 --- a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result @@ -461,6 +461,7 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist DELETE FROM t1; Warnings: Error 12702 Remote table 'auto_test_remote.ter1_1' is not found +Error 12702 Remote table 'auto_test_remote.ter1_1' is not found Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist TRUNCATE t1; Warnings: diff --git a/storage/spider/mysql-test/spider/handler/r/direct_update.result b/storage/spider/mysql-test/spider/handler/r/direct_update.result index 74dae7aec2e..0e536d48617 100644 --- a/storage/spider/mysql-test/spider/handler/r/direct_update.result +++ b/storage/spider/mysql-test/spider/handler/r/direct_update.result @@ -48,6 +48,7 @@ direct_updating test connection master_1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -59,6 +60,7 @@ update all rows with function UPDATE ta_l SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -70,6 +72,7 @@ update by primary key UPDATE ta_l SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -81,6 +84,7 @@ update by a column without index UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -92,6 +96,7 @@ update by primary key with order and limit UPDATE ta_l SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -103,6 +108,7 @@ delete by primary key with order and limit DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -113,6 +119,7 @@ delete by a column without index DELETE FROM ta_l WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -122,6 +129,7 @@ delete by primary key DELETE FROM ta_l WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 diff --git a/storage/spider/mysql-test/spider/handler/r/direct_update_part.result b/storage/spider/mysql-test/spider/handler/r/direct_update_part.result index 6db7c01f563..7069cd72fda 100644 --- a/storage/spider/mysql-test/spider/handler/r/direct_update_part.result +++ b/storage/spider/mysql-test/spider/handler/r/direct_update_part.result @@ -38,6 +38,7 @@ PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -49,6 +50,7 @@ update all rows with function UPDATE ta_l2 SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -60,6 +62,7 @@ update by primary key UPDATE ta_l2 SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -71,6 +74,7 @@ update by a column without index UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 5 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -82,6 +86,7 @@ update by primary key with order and limit UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 6 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -93,6 +98,7 @@ delete by primary key with order and limit DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -103,6 +109,7 @@ delete by a column without index DELETE FROM ta_l2 WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -112,6 +119,7 @@ delete by primary key DELETE FROM ta_l2 WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 diff --git a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result index 9b14817eee4..c171167a1b7 100644 --- a/storage/spider/mysql-test/spider/handler/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/handler/r/spider_fixes.result @@ -465,6 +465,7 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist DELETE FROM t1; Warnings: Error 12702 Remote table 'auto_test_remote.ter1_1' is not found +Error 12702 Remote table 'auto_test_remote.ter1_1' is not found Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist TRUNCATE t1; Warnings: diff --git a/storage/spider/mysql-test/spider/handler/suite.pm b/storage/spider/mysql-test/spider/handler/suite.pm index f106147deb6..b023e5206ef 100644 --- a/storage/spider/mysql-test/spider/handler/suite.pm +++ b/storage/spider/mysql-test/spider/handler/suite.pm @@ -9,4 +9,3 @@ return "Test needs --big-test" unless $::opt_big_test; sub is_default { 1 } bless { }; - diff --git a/storage/spider/mysql-test/spider/include/deinit_spider.inc b/storage/spider/mysql-test/spider/include/deinit_spider.inc index c9c414eb56e..3609551e169 100644 --- a/storage/spider/mysql-test/spider/include/deinit_spider.inc +++ b/storage/spider/mysql-test/spider/include/deinit_spider.inc @@ -6,9 +6,13 @@ DROP FUNCTION spider_flush_table_mon_cache; UNINSTALL PLUGIN spider; DROP TABLE IF EXISTS mysql.spider_xa; DROP TABLE IF EXISTS mysql.spider_xa_member; +DROP TABLE IF EXISTS mysql.spider_xa_failed_log; DROP TABLE IF EXISTS mysql.spider_tables; DROP TABLE IF EXISTS mysql.spider_link_mon_servers; DROP TABLE IF EXISTS mysql.spider_link_failed_log; +DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; +DROP TABLE IF EXISTS mysql.spider_table_sts; +DROP TABLE IF EXISTS mysql.spider_table_crd; DROP SERVER s_2_1; DROP SERVER s_2_2; DROP SERVER s_2_3; diff --git a/storage/spider/mysql-test/spider/include/direct_join_deinit.inc b/storage/spider/mysql-test/spider/include/direct_join_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_join_deinit.inc @@ -0,0 +1,9 @@ +--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/direct_join_init.inc b/storage/spider/mysql-test/spider/include/direct_join_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_join_init.inc @@ -0,0 +1,13 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 +--let $OUTPUT_CHILD_GROUP2= 1 +--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG +--let $USE_GENERAL_LOG= 1 diff --git a/storage/spider/mysql-test/spider/include/init_spider.inc b/storage/spider/mysql-test/spider/include/init_spider.inc index 90c4b7d7084..f94bd51edd7 100644 --- a/storage/spider/mysql-test/spider/include/init_spider.inc +++ b/storage/spider/mysql-test/spider/include/init_spider.inc @@ -277,10 +277,35 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) default_group char(64) default null, KEY idx1 (data, format_id, gtrid_length, host) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + DROP TABLE IF EXISTS mysql.spider_xa_failed_log; + CREATE TABLE mysql.spider_xa_failed_log( + format_id int not null default 0, + gtrid_length int not null default 0, + bqual_length int not null default 0, + data char(128) charset binary not null default '', + scheme char(64) not null default '', + host char(64) not null default '', + port char(5) not null default '', + socket text not null, + username char(64) not null default '', + password char(64) not null default '', + ssl_ca text, + ssl_capath text, + ssl_cert text, + ssl_cipher char(64) default null, + ssl_key text, + ssl_verify_server_cert tinyint not null default 0, + default_file text, + default_group char(64) default null, + thread_id int default null, + status char(8) not null default '', + failed_time timestamp not null default current_timestamp, + key idx1 (data, format_id, gtrid_length, host) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_tables; CREATE TABLE mysql.spider_tables( db_name char(64) not null default '', - table_name char(64) not null default '', + table_name char(199) not null default '', link_id int not null default 0, priority bigint not null default 0, server char(64) default null, @@ -296,18 +321,22 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) ssl_cipher char(64) default null, ssl_key text default null, ssl_verify_server_cert tinyint not null default 0, + monitoring_binlog_pos_at_failing tinyint not null default 0, default_file text default null, default_group char(64) default null, tgt_db_name char(64) default null, tgt_table_name char(64) default null, link_status tinyint not null default 1, + block_status tinyint not null default 0, + static_link_id char(64) default null, PRIMARY KEY (db_name, table_name, link_id), - KEY idx1 (priority) + KEY idx1 (priority), + UNIQUE KEY uidx1 (db_name, table_name, static_link_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_link_mon_servers; CREATE TABLE mysql.spider_link_mon_servers( db_name char(64) not null default '', - table_name char(64) not null default '', + table_name char(199) not null default '', link_id char(5) not null default '', sid int not null default 0, server char(64) default null, @@ -330,10 +359,43 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) DROP TABLE IF EXISTS mysql.spider_link_failed_log; CREATE TABLE mysql.spider_link_failed_log( db_name char(64) not null default '', - table_name char(64) not null default '', + table_name char(199) not null default '', link_id int not null default 0, failed_time timestamp not null default current_timestamp ) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; + CREATE TABLE mysql.spider_table_position_for_recovery( + db_name char(64) not null default '', + table_name char(199) not null default '', + failed_link_id int not null default 0, + source_link_id int not null default 0, + file text, + position text, + gtid text, + primary key (db_name, table_name, failed_link_id, source_link_id) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + DROP TABLE IF EXISTS mysql.spider_table_sts; + CREATE TABLE mysql.spider_table_sts( + db_name char(64) not null default '', + table_name char(199) not null default '', + data_file_length bigint unsigned not null default 0, + max_data_file_length bigint unsigned not null default 0, + index_file_length bigint unsigned not null default 0, + records bigint unsigned not null default 0, + mean_rec_length bigint unsigned not null default 0, + check_time datetime not null default '0000-00-00 00:00:00', + create_time datetime not null default '0000-00-00 00:00:00', + update_time datetime not null default '0000-00-00 00:00:00', + primary key (db_name, table_name) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + DROP TABLE IF EXISTS mysql.spider_table_crd; + CREATE TABLE mysql.spider_table_crd( + db_name char(64) not null default '', + table_name char(199) not null default '', + key_seq int unsigned not null default 0, + cardinality bigint not null default 0, + primary key (db_name, table_name, key_seq) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; } SET spider_internal_sql_log_off= 0; diff --git a/storage/spider/mysql-test/spider/include/partition_cond_push_deinit.inc b/storage/spider/mysql-test/spider/include/partition_cond_push_deinit.inc new file mode 100644 index 00000000000..668eaa2fdba --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_cond_push_deinit.inc @@ -0,0 +1,20 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP +--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP +--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP +--let $CHILD2_3_DROP_TABLES= $CHILD2_3_DROP_TABLES_BACKUP +--let $CHILD2_3_CREATE_TABLES= $CHILD2_3_CREATE_TABLES_BACKUP +--let $CHILD2_3_SELECT_TABLES= $CHILD2_3_SELECT_TABLES_BACKUP +--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/partition_cond_push_init.inc b/storage/spider/mysql-test/spider/include/partition_cond_push_init.inc new file mode 100644 index 00000000000..30a333d6699 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_cond_push_init.inc @@ -0,0 +1,58 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a"' + PARTITION BY KEY(value) ( + PARTITION pt1 COMMENT='srv "s_2_1"', + PARTITION pt2 COMMENT='srv "s_2_2"', + PARTITION pt3 COMMENT='srv "s_2_3"' + ); +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + value int NOT NULL + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT value FROM tbl_a ORDER BY value; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES +let $CHILD2_2_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + CREATE TABLE tbl_a ( + value int NOT NULL + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES +let $CHILD2_2_SELECT_TABLES= + SELECT value FROM tbl_a ORDER BY value; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_3_DROP_TABLES_BACKUP= $CHILD2_3_DROP_TABLES +let $CHILD2_3_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_3_CREATE_TABLES_BACKUP= $CHILD2_3_CREATE_TABLES +let $CHILD2_3_CREATE_TABLES= + CREATE TABLE tbl_a ( + value int NOT NULL + ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; +--let $CHILD2_3_SELECT_TABLES_BACKUP= $CHILD2_3_SELECT_TABLES +let $CHILD2_3_SELECT_TABLES= + SELECT value FROM tbl_a ORDER BY value; +let $CHILD2_3_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 +--let $OUTPUT_CHILD_GROUP2= 1 +--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG +--let $USE_GENERAL_LOG= 1 diff --git a/storage/spider/mysql-test/spider/include/partition_fulltext_deinit.inc b/storage/spider/mysql-test/spider/include/partition_fulltext_deinit.inc new file mode 100644 index 00000000000..c0c652d14f5 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_fulltext_deinit.inc @@ -0,0 +1,23 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP +--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP +--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP +--let $CHILD2_3_DROP_TABLES= $CHILD2_3_DROP_TABLES_BACKUP +--let $CHILD2_3_CREATE_TABLES= $CHILD2_3_CREATE_TABLES_BACKUP +--let $CHILD2_3_SELECT_TABLES= $CHILD2_3_SELECT_TABLES_BACKUP +--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session join_cache_level= @old_join_cache_level; +set session optimizer_switch= @old_optimizer_switch; +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/partition_fulltext_init.inc b/storage/spider/mysql-test/spider/include/partition_fulltext_init.inc new file mode 100644 index 00000000000..754395493af --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_fulltext_init.inc @@ -0,0 +1,72 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a", bka_mode "1"' + PARTITION BY KEY(pkey) ( + PARTITION pt1 COMMENT='srv "s_2_1"', + PARTITION pt2 COMMENT='srv "s_2_2"', + PARTITION pt3 COMMENT='srv "s_2_3"' + ); +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + words text NOT NULL, + PRIMARY KEY (pkey), + FULLTEXT (words) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES +let $CHILD2_2_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + words text NOT NULL, + PRIMARY KEY (pkey), + FULLTEXT (words) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES +let $CHILD2_2_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_3_DROP_TABLES_BACKUP= $CHILD2_3_DROP_TABLES +let $CHILD2_3_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_3_CREATE_TABLES_BACKUP= $CHILD2_3_CREATE_TABLES +let $CHILD2_3_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + words text NOT NULL, + PRIMARY KEY (pkey), + FULLTEXT (words) + ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; +--let $CHILD2_3_SELECT_TABLES_BACKUP= $CHILD2_3_SELECT_TABLES +let $CHILD2_3_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey; +let $CHILD2_3_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 +--let $OUTPUT_CHILD_GROUP2= 1 +--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG +--let $USE_GENERAL_LOG= 1 +--connection master_1 +set @old_join_cache_level= @@join_cache_level; +set session join_cache_level= 5; +set @old_optimizer_switch= @@optimizer_switch; +set session optimizer_switch= 'mrr=on'; diff --git a/storage/spider/mysql-test/spider/include/partition_join_pushdown_for_single_partition_deinit.inc b/storage/spider/mysql-test/spider/include/partition_join_pushdown_for_single_partition_deinit.inc new file mode 100644 index 00000000000..d9dfcf23ed6 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_join_pushdown_for_single_partition_deinit.inc @@ -0,0 +1,30 @@ +--connection master_1 +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $CHILD2_1_DROP_TABLES2= $CHILD2_1_DROP_TABLES2_BACKUP +--let $CHILD2_1_CREATE_TABLES2= $CHILD2_1_CREATE_TABLES2_BACKUP +--let $CHILD2_1_SELECT_TABLES2= $CHILD2_1_SELECT_TABLES2_BACKUP +--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP +--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP +--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP +--let $CHILD2_2_DROP_TABLES2= $CHILD2_2_DROP_TABLES2_BACKUP +--let $CHILD2_2_CREATE_TABLES2= $CHILD2_2_CREATE_TABLES2_BACKUP +--let $CHILD2_2_SELECT_TABLES2= $CHILD2_2_SELECT_TABLES2_BACKUP +--let $CHILD2_3_DROP_TABLES= $CHILD2_3_DROP_TABLES_BACKUP +--let $CHILD2_3_CREATE_TABLES= $CHILD2_3_CREATE_TABLES_BACKUP +--let $CHILD2_3_SELECT_TABLES= $CHILD2_3_SELECT_TABLES_BACKUP +--let $CHILD2_3_DROP_TABLES2= $CHILD2_3_DROP_TABLES2_BACKUP +--let $CHILD2_3_CREATE_TABLES2= $CHILD2_3_CREATE_TABLES2_BACKUP +--let $CHILD2_3_SELECT_TABLES2= $CHILD2_3_SELECT_TABLES2_BACKUP +--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/partition_join_pushdown_for_single_partition_init.inc b/storage/spider/mysql-test/spider/include/partition_join_pushdown_for_single_partition_init.inc new file mode 100644 index 00000000000..dccffa60c0d --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_join_pushdown_for_single_partition_init.inc @@ -0,0 +1,105 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a"' + PARTITION BY RANGE(value) ( + PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1"', + PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_2"', + PARTITION pt3 VALUES LESS THAN (15) COMMENT='srv "s_2_3"' + ); +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b"' + PARTITION BY RANGE(value2) ( + PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1"', + PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_2"', + PARTITION pt3 VALUES LESS THAN (15) COMMENT='srv "s_2_3"' + ); +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + value int NOT NULL, + PRIMARY KEY(value) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT value FROM tbl_a ORDER BY value; +--let $CHILD2_1_DROP_TABLES2_BACKUP= $CHILD2_1_DROP_TABLES2 +let $CHILD2_1_DROP_TABLES2= + DROP TABLE IF EXISTS tbl_b; +--let $CHILD2_1_CREATE_TABLES2_BACKUP= $CHILD2_1_CREATE_TABLES2 +let $CHILD2_1_CREATE_TABLES2= + CREATE TABLE tbl_b ( + value2 int NOT NULL, + PRIMARY KEY(value2) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES2_BACKUP= $CHILD2_1_SELECT_TABLES2 +let $CHILD2_1_SELECT_TABLES2= + SELECT value FROM tbl_b ORDER BY value2; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES +let $CHILD2_2_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + CREATE TABLE tbl_a ( + value int NOT NULL, + PRIMARY KEY(value) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES +let $CHILD2_2_SELECT_TABLES= + SELECT value FROM tbl_a ORDER BY value; +--let $CHILD2_2_DROP_TABLES2_BACKUP= $CHILD2_2_DROP_TABLES2 +let $CHILD2_2_DROP_TABLES2= + DROP TABLE IF EXISTS tbl_b; +--let $CHILD2_2_CREATE_TABLES2_BACKUP= $CHILD2_2_CREATE_TABLES2 +let $CHILD2_2_CREATE_TABLES2= + CREATE TABLE tbl_b ( + value2 int NOT NULL, + PRIMARY KEY(value2) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES2_BACKUP= $CHILD2_2_SELECT_TABLES2 +let $CHILD2_2_SELECT_TABLES2= + SELECT value FROM tbl_b ORDER BY value; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_3_DROP_TABLES_BACKUP= $CHILD2_3_DROP_TABLES +let $CHILD2_3_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_3_CREATE_TABLES_BACKUP= $CHILD2_3_CREATE_TABLES +let $CHILD2_3_CREATE_TABLES= + CREATE TABLE tbl_a ( + value int NOT NULL, + PRIMARY KEY(value) + ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; +--let $CHILD2_3_SELECT_TABLES_BACKUP= $CHILD2_3_SELECT_TABLES +let $CHILD2_3_SELECT_TABLES= + SELECT value FROM tbl_a ORDER BY value; +--let $CHILD2_3_DROP_TABLES2_BACKUP= $CHILD2_3_DROP_TABLES2 +let $CHILD2_3_DROP_TABLES2= + DROP TABLE IF EXISTS tbl_b; +--let $CHILD2_3_CREATE_TABLES2_BACKUP= $CHILD2_3_CREATE_TABLES2 +let $CHILD2_3_CREATE_TABLES2= + CREATE TABLE tbl_b ( + value2 int NOT NULL, + PRIMARY KEY(value2) + ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; +--let $CHILD2_3_SELECT_TABLES2_BACKUP= $CHILD2_3_SELECT_TABLES2 +let $CHILD2_3_SELECT_TABLES2= + SELECT value FROM tbl_b ORDER BY value; +let $CHILD2_3_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 +--let $OUTPUT_CHILD_GROUP2= 1 +--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG +--let $USE_GENERAL_LOG= 1 diff --git a/storage/spider/mysql-test/spider/include/partition_mrr_deinit.inc b/storage/spider/mysql-test/spider/include/partition_mrr_deinit.inc new file mode 100644 index 00000000000..c0c652d14f5 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_mrr_deinit.inc @@ -0,0 +1,23 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP +--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP +--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP +--let $CHILD2_3_DROP_TABLES= $CHILD2_3_DROP_TABLES_BACKUP +--let $CHILD2_3_CREATE_TABLES= $CHILD2_3_CREATE_TABLES_BACKUP +--let $CHILD2_3_SELECT_TABLES= $CHILD2_3_SELECT_TABLES_BACKUP +--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session join_cache_level= @old_join_cache_level; +set session optimizer_switch= @old_optimizer_switch; +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/partition_mrr_init.inc b/storage/spider/mysql-test/spider/include/partition_mrr_init.inc new file mode 100644 index 00000000000..03e113940a7 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/partition_mrr_init.inc @@ -0,0 +1,92 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='table "tbl_a", bka_mode "1"' + PARTITION BY KEY(pkey) ( + PARTITION pt1 COMMENT='srv "s_2_1"', + PARTITION pt2 COMMENT='srv "s_2_2"', + PARTITION pt3 COMMENT='srv "s_2_3"' + ); +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", bka_mode "1"' + PARTITION BY KEY(pkey) ( + PARTITION pt1 COMMENT='srv "s_2_2"', + PARTITION pt2 COMMENT='srv "s_2_3"', + PARTITION pt3 COMMENT='srv "s_2_1"' + ); +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a $STR_SEMICOLON + DROP TABLE IF EXISTS tbl_b; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET $STR_SEMICOLON + CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey $STR_SEMICOLON + SELECT pkey FROM tbl_b ORDER BY pkey; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES +let $CHILD2_2_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a $STR_SEMICOLON + DROP TABLE IF EXISTS tbl_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET $STR_SEMICOLON + CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_2_ENGINE $CHILD2_2_CHARSET; +--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES +let $CHILD2_2_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey $STR_SEMICOLON + SELECT pkey FROM tbl_b ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $CHILD2_3_DROP_TABLES_BACKUP= $CHILD2_3_DROP_TABLES +let $CHILD2_3_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a $STR_SEMICOLON + DROP TABLE IF EXISTS tbl_b; +--let $CHILD2_3_CREATE_TABLES_BACKUP= $CHILD2_3_CREATE_TABLES +let $CHILD2_3_CREATE_TABLES= + CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET $STR_SEMICOLON + CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $CHILD2_3_ENGINE $CHILD2_3_CHARSET; +--let $CHILD2_3_SELECT_TABLES_BACKUP= $CHILD2_3_SELECT_TABLES +let $CHILD2_3_SELECT_TABLES= + SELECT pkey FROM tbl_a ORDER BY pkey $STR_SEMICOLON + SELECT pkey FROM tbl_b ORDER BY pkey; +let $CHILD2_3_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 +--let $OUTPUT_CHILD_GROUP2= 1 +--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG +--let $USE_GENERAL_LOG= 1 +--connection master_1 +set @old_join_cache_level= @@join_cache_level; +set session join_cache_level= 5; +set @old_optimizer_switch= @@optimizer_switch; +set session optimizer_switch= 'mrr=on'; diff --git a/storage/spider/mysql-test/spider/r/auto_increment.result b/storage/spider/mysql-test/spider/r/auto_increment.result new file mode 100644 index 00000000000..cbc7fee0671 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/auto_increment.result @@ -0,0 +1,186 @@ +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 select test +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +col_a INT NOT NULL AUTO_INCREMENT, +col_b VARCHAR(20) DEFAULT 'defg', +col_c INT NOT NULL DEFAULT 100, +PRIMARY KEY(col_a) +) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1 +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` int(11) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` int(11) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +ALTER TABLE tbl_a MODIFY col_c MEDIUMINT NOT NULL DEFAULT 100; +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +RENAME TABLE tbl_a TO tbl_x; +SHOW CREATE TABLE tbl_x; +Table Create Table +tbl_x CREATE TABLE `tbl_x` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +RENAME TABLE tbl_x TO tbl_a; +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +MASTER_1_AUTO_INCREMENT1 +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=30 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +MASTER_1_AUTO_INCREMENT2 +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +Table Create Table +tbl_a CREATE TABLE `tbl_a` ( + `col_a` int(11) NOT NULL AUTO_INCREMENT, + `col_b` varchar(20) DEFAULT 'defg', + `col_c` mediumint(9) NOT NULL DEFAULT 100, + PRIMARY KEY (`col_a`) +) ENGINE=SPIDER AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"' + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT * FROM tbl_a; +col_a col_b col_c +1 def 10 +2 def 10 +3 def 10 +4 def 10 +5 def 10 +6 def 10 +7 def 10 +8 def 10 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `col_a`,`col_b`,`col_c` from `auto_test_remote`.`tbl_a` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT col_a, col_b, col_c FROM tbl_a ORDER BY col_a; +col_a col_b col_c +1 def 10 +2 def 10 +3 def 10 +4 def 10 +5 def 10 +6 def 10 +7 def 10 +8 def 10 + +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 diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate.result b/storage/spider/mysql-test/spider/r/direct_aggregate.result index 9a8660ba79e..ede48906a84 100644 --- a/storage/spider/mysql-test/spider/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/r/direct_aggregate.result @@ -60,25 +60,25 @@ MAX(a) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 1 SELECT MIN(a) FROM ta_l; MIN(a) 1 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 2 SELECT MAX(a) FROM ta_l WHERE a < 5; MAX(a) 4 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 3 SELECT MIN(a) FROM ta_l WHERE a > 1; MIN(a) 2 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +Spider_direct_aggregate 4 deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result index 760b39e16d5..02cdc033a88 100644 --- a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result +++ b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result @@ -44,31 +44,31 @@ COUNT(*) 5 SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value -Spider_direct_aggregate 0 +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 0 +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 0 +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 0 +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 0 +Spider_direct_aggregate 10 deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/r/direct_join.result b/storage/spider/mysql-test/spider/r/direct_join.result new file mode 100644 index 00000000000..5cc44a56910 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_join.result @@ -0,0 +1,105 @@ +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, tbl_b b, tbl_c c WHERE a.a = b.a and a.a = c.a ORDER BY a.b DESC LIMIT 1,2; +a b c +4 40 400 +3 30 300 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r` t0,`auto_test_remote`.`ta_r_3` t1,`auto_test_remote`.`ta_r_int` t2 where ((t0.`a` = t1.`a`) and (t2.`a` = t1.`a`)) order by t0.`b` desc limit 1,2 +SELECT argument FROM mysql.general_log WHERE 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 diff --git a/storage/spider/mysql-test/spider/r/direct_update.result b/storage/spider/mysql-test/spider/r/direct_update.result index 74dae7aec2e..0e536d48617 100644 --- a/storage/spider/mysql-test/spider/r/direct_update.result +++ b/storage/spider/mysql-test/spider/r/direct_update.result @@ -48,6 +48,7 @@ direct_updating test connection master_1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -59,6 +60,7 @@ update all rows with function UPDATE ta_l SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -70,6 +72,7 @@ update by primary key UPDATE ta_l SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -81,6 +84,7 @@ update by a column without index UPDATE ta_l SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -92,6 +96,7 @@ update by primary key with order and limit UPDATE ta_l SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -103,6 +108,7 @@ delete by primary key with order and limit DELETE FROM ta_l WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -113,6 +119,7 @@ delete by a column without index DELETE FROM ta_l WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -122,6 +129,7 @@ delete by primary key DELETE FROM ta_l WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 diff --git a/storage/spider/mysql-test/spider/r/direct_update_part.result b/storage/spider/mysql-test/spider/r/direct_update_part.result index 6db7c01f563..7069cd72fda 100644 --- a/storage/spider/mysql-test/spider/r/direct_update_part.result +++ b/storage/spider/mysql-test/spider/r/direct_update_part.result @@ -38,6 +38,7 @@ PRIMARY KEY(a) ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 0 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-01 10:21:39 @@ -49,6 +50,7 @@ update all rows with function UPDATE ta_l2 SET c = ADDDATE(c, 1); SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 2 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -60,6 +62,7 @@ update by primary key UPDATE ta_l2 SET b = 'x' WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -71,6 +74,7 @@ update by a column without index UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 5 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -82,6 +86,7 @@ update by primary key with order and limit UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; SHOW STATUS LIKE 'Spider_direct_update'; Variable_name Value +Spider_direct_update 6 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -93,6 +98,7 @@ delete by primary key with order and limit DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 1 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -103,6 +109,7 @@ delete by a column without index DELETE FROM ta_l2 WHERE b = 'c'; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 3 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 @@ -112,6 +119,7 @@ delete by primary key DELETE FROM ta_l2 WHERE a = 3; SHOW STATUS LIKE 'Spider_direct_delete'; Variable_name Value +Spider_direct_delete 4 SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 diff --git a/storage/spider/mysql-test/spider/r/partition_cond_push.result b/storage/spider/mysql-test/spider/r/partition_cond_push.result new file mode 100644 index 00000000000..ce26416b9f8 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/partition_cond_push.result @@ -0,0 +1,168 @@ +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; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_3; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_DROP_TABLES +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_3; +CHILD2_3_DROP_TABLES +CHILD2_3_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +CREATE TABLE tbl_a ( +value int NOT NULL +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (value) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (value) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (value) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT value FROM tbl_a WHERE value < 100; +value +4 +5 +10 +11 +16 +17 +22 +23 +28 +29 +0 +1 +6 +7 +12 +13 +18 +19 +24 +25 +2 +3 +8 +9 +14 +15 +20 +21 +26 +27 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `value` from `auto_test_remote`.`tbl_a` where (`value` < 100) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT value FROM tbl_a ORDER BY value; +value +4 +5 +10 +11 +16 +17 +22 +23 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `value` from `auto_test_remote2`.`tbl_a` where (`value` < 100) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT value FROM tbl_a ORDER BY value; +value +0 +1 +6 +7 +12 +13 +18 +19 +24 +25 +connection child2_3; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `value` from `auto_test_remote3`.`tbl_a` where (`value` < 100) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT value FROM tbl_a ORDER BY value; +value +2 +3 +8 +9 +14 +15 +20 +21 +26 +27 + +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; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection child2_3; +DROP DATABASE IF EXISTS auto_test_remote3; +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 diff --git a/storage/spider/mysql-test/spider/r/partition_fulltext.result b/storage/spider/mysql-test/spider/r/partition_fulltext.result new file mode 100644 index 00000000000..3289473b905 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/partition_fulltext.result @@ -0,0 +1,126 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_join_cache_level= @@join_cache_level; +set session join_cache_level= 5; +set @old_optimizer_switch= @@optimizer_switch; +set session optimizer_switch= 'mrr=on'; + +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; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_3; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_DROP_TABLES +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_3; +CHILD2_3_DROP_TABLES +CHILD2_3_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +words text NOT NULL, +PRIMARY KEY (pkey), +FULLTEXT (words) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey, words) VALUES (0, 'abc'),(1, 'def'),(2, 'ghi'),(3, 'jkl'),(4, 'mno'),(5, 'pqr'),(6, 'stu'),(7, 'vwx'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT pkey, words FROM tbl_a WHERE match(words) against('+ghi' in boolean mode); +pkey words +2 ghi +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select match(`words`)against('+ghi' in boolean mode),`pkey`,`words` from `auto_test_remote`.`tbl_a` where match(`words`)against('+ghi' in boolean mode) and (match(`words`)against('+ghi' in boolean mode)) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +4 +5 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select match(`words`)against('+ghi' in boolean mode),`pkey`,`words` from `auto_test_remote2`.`tbl_a` where match(`words`)against('+ghi' in boolean mode) and (match(`words`)against('+ghi' in boolean mode)) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +6 +7 +connection child2_3; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select match(`words`)against('+ghi' in boolean mode),`pkey`,`words` from `auto_test_remote3`.`tbl_a` where match(`words`)against('+ghi' in boolean mode) and (match(`words`)against('+ghi' in boolean mode)) +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +2 +3 + +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; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection child2_3; +DROP DATABASE IF EXISTS auto_test_remote3; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session join_cache_level= @old_join_cache_level; +set session optimizer_switch= @old_optimizer_switch; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result b/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result new file mode 100644 index 00000000000..899788ae1c1 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/partition_join_pushdown_for_single_partition.result @@ -0,0 +1,130 @@ +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; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_3; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_DROP_TABLES2 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES2 +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_DROP_TABLES +CHILD2_2_DROP_TABLES2 +CHILD2_2_CREATE_TABLES +CHILD2_2_CREATE_TABLES2 +TRUNCATE TABLE mysql.general_log; +connection child2_3; +CHILD2_3_DROP_TABLES +CHILD2_3_DROP_TABLES2 +CHILD2_3_CREATE_TABLES +CHILD2_3_CREATE_TABLES2 +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +CREATE TABLE tbl_a ( +value int NOT NULL, +PRIMARY KEY(value) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +CREATE TABLE tbl_b ( +value2 int NOT NULL, +PRIMARY KEY(value2) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2 +insert into tbl_a values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +insert into tbl_b values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +connection master_1; +SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = b.value2 AND a.value = 5; +sum(a.value) count(b.value2) +5 1 +SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = 5 and b.value2 = 5; +sum(a.value) count(b.value2) +5 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT value FROM tbl_a ORDER BY value; +value +1 +2 +3 +4 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `value` from `auto_test_remote2`.`tbl_a` where `value` = 5 +select `value2` from `auto_test_remote2`.`tbl_b` where `value2` = 5 +select `value` from `auto_test_remote2`.`tbl_a` where `value` = 5 +select `value2` from `auto_test_remote2`.`tbl_b` where `value2` = 5 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT value FROM tbl_a ORDER BY value; +value +5 +6 +7 +8 +9 +connection child2_3; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT value FROM tbl_a ORDER BY value; +value +10 + +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; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection child2_3; +DROP DATABASE IF EXISTS auto_test_remote3; +SET GLOBAL log_output = @old_log_output; +connection master_1; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/partition_mrr.result b/storage/spider/mysql-test/spider/r/partition_mrr.result new file mode 100644 index 00000000000..2335e8933a4 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/partition_mrr.result @@ -0,0 +1,223 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_join_cache_level= @@join_cache_level; +set session join_cache_level= 5; +set @old_optimizer_switch= @@optimizer_switch; +set session optimizer_switch= 'mrr=on'; + +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; +connection child2_2; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +connection child2_3; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_DROP_TABLES +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_3; +CHILD2_3_DROP_TABLES +CHILD2_3_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +CREATE TABLE tbl_b ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2 +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); +INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +4 +5 +10 +11 +16 +17 +22 +23 +28 +29 +0 +1 +6 +7 +12 +13 +18 +19 +24 +25 +2 +3 +8 +9 +14 +15 +20 +21 +26 +27 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey` +select a.id,b.`pkey` from auto_test_remote.tmp_spider_bka_xxxx a,`auto_test_remote`.`tbl_b` b where a.c0 <=> b.`pkey` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey ; +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +4 +5 +10 +11 +16 +17 +22 +23 +28 +29 +pkey +2 +3 +8 +9 +14 +15 +20 +21 +26 +27 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey` +select a.id,b.`pkey` from auto_test_remote2.tmp_spider_bka_xxxx a,`auto_test_remote2`.`tbl_b` b where a.c0 <=> b.`pkey` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey ; +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +6 +7 +12 +13 +18 +19 +24 +25 +pkey +4 +5 +10 +11 +16 +17 +22 +23 +28 +29 +connection child2_3; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey` +select a.id,b.`pkey` from auto_test_remote3.tmp_spider_bka_xxxx a,`auto_test_remote3`.`tbl_b` b where a.c0 <=> b.`pkey` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey ; +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +2 +3 +8 +9 +14 +15 +20 +21 +26 +27 +pkey +0 +1 +6 +7 +12 +13 +18 +19 +24 +25 + +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; +connection child2_2; +DROP DATABASE IF EXISTS auto_test_remote2; +SET GLOBAL log_output = @old_log_output; +connection child2_3; +DROP DATABASE IF EXISTS auto_test_remote3; +SET GLOBAL log_output = @old_log_output; +connection master_1; +set session join_cache_level= @old_join_cache_level; +set session optimizer_switch= @old_optimizer_switch; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result index b793346df4b..937f222f02f 100644 --- a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result +++ b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result @@ -85,10 +85,10 @@ MASTER_1_AUTO_INCREMENT_OFFSET3 INSERT INTO t1 (id) VALUES (null); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() -778 +1555 SELECT MAX(id) FROM t1; MAX(id) -1554 +1555 MASTER_1_AUTO_INCREMENT_OFFSET4 INSERT INTO t2 (id) VALUES (null); SELECT LAST_INSERT_ID(); @@ -101,36 +101,36 @@ MASTER_1_AUTO_INCREMENT_OFFSET3 INSERT INTO t1 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() -1555 +2332 SELECT id FROM t1 ORDER BY id; id 777 -778 1554 1555 2331 2332 3109 3886 +4663 MASTER_1_AUTO_INCREMENT_OFFSET4 INSERT INTO t2 () VALUES (),(),(),(); SELECT LAST_INSERT_ID(); LAST_INSERT_ID() -3108 +5439 SELECT id FROM t2 ORDER BY id; id 777 -778 1554 1555 2331 2332 -3108 3109 -3885 3886 -4662 +4663 5439 +6216 +6993 +7770 TRUNCATE TABLE t1; TRUNCATE TABLE t2; INSERT INTO t1 () VALUES (),(),(),(); diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result index f50c9822534..1db31ca9f95 100644 --- a/storage/spider/mysql-test/spider/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/r/spider_fixes.result @@ -461,6 +461,7 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist DELETE FROM t1; Warnings: Error 12702 Remote table 'auto_test_remote.ter1_1' is not found +Error 12702 Remote table 'auto_test_remote.ter1_1' is not found Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist TRUNCATE t1; Warnings: diff --git a/storage/spider/mysql-test/spider/t/auto_increment.test b/storage/spider/mysql-test/spider/t/auto_increment.test new file mode 100644 index 00000000000..12d93ca3e72 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/auto_increment.test @@ -0,0 +1,185 @@ +--source auto_increment_init.inc + +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + if ($USE_GENERAL_LOG) + { + 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; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo create table select test +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + col_a INT NOT NULL AUTO_INCREMENT, + col_b VARCHAR(20) DEFAULT 'defg', + col_c INT NOT NULL DEFAULT 100, + PRIMARY KEY(col_a) +) MASTER_1_ENGINE MASTER_1_AUTO_INCREMENT_2_1 MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + col_a INT NOT NULL AUTO_INCREMENT, + col_b VARCHAR(20) DEFAULT 'defg', + col_c INT NOT NULL DEFAULT 100, + PRIMARY KEY(col_a) +) $MASTER_1_ENGINE $MASTER_1_AUTO_INCREMENT_2_1 $MASTER_1_COMMENT_2_1; +--enable_query_log +SHOW CREATE TABLE tbl_a; +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +ALTER TABLE tbl_a MODIFY col_c MEDIUMINT NOT NULL DEFAULT 100; +SHOW CREATE TABLE tbl_a; +RENAME TABLE tbl_a TO tbl_x; +SHOW CREATE TABLE tbl_x; +RENAME TABLE tbl_x TO tbl_a; +SHOW CREATE TABLE tbl_a; +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +--disable_query_log +echo MASTER_1_AUTO_INCREMENT1; +eval $MASTER_1_AUTO_INCREMENT1; +--enable_query_log +SHOW CREATE TABLE tbl_a; +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; +--disable_query_log +echo MASTER_1_AUTO_INCREMENT2; +eval $MASTER_1_AUTO_INCREMENT2; +--enable_query_log +SHOW CREATE TABLE tbl_a; +INSERT INTO tbl_a () VALUES (); +INSERT INTO tbl_a () VALUES (); +SHOW CREATE TABLE tbl_a; + +--echo +--echo select test +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +SELECT * FROM tbl_a; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_1_SELECT_ARGUMENT1; + } + eval $CHILD2_1_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } +} +--enable_warnings +--source auto_increment_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc b/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc new file mode 100644 index 00000000000..52be67a1d09 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/auto_increment_deinit.inc @@ -0,0 +1,13 @@ +--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP +--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP +--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP +--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP +--let $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/t/auto_increment_init.inc b/storage/spider/mysql-test/spider/t/auto_increment_init.inc new file mode 100644 index 00000000000..e4c1325072a --- /dev/null +++ b/storage/spider/mysql-test/spider/t/auto_increment_init.inc @@ -0,0 +1,38 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1 +let $MASTER_1_COMMENT_2_1= + COMMENT='database "auto_test_remote", table "tbl_a", srv "s_2_1", aim "0"'; +let $MASTER_1_AUTO_INCREMENT_2_1= + AUTO_INCREMENT=20; +let $MASTER_1_AUTO_INCREMENT1= + ALTER TABLE tbl_a AUTO_INCREMENT=30; +let $MASTER_1_AUTO_INCREMENT2= + ALTER TABLE tbl_a AUTO_INCREMENT=10; +let $CHILD2_1_CHARSET_AUTO_INCREMENT= + AUTO_INCREMENT=20; +--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES +let $CHILD2_1_DROP_TABLES= + DROP TABLE IF EXISTS tbl_a; +--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES +let $CHILD2_1_CREATE_TABLES= + CREATE TABLE tbl_a ( + col_a INT NOT NULL AUTO_INCREMENT, + col_b VARCHAR(20) DEFAULT 'def', + col_c INT NOT NULL DEFAULT 10, + PRIMARY KEY(col_a) + ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET_AUTO_INCREMENT $CHILD2_1_CHARSET; +--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES +let $CHILD2_1_SELECT_TABLES= + SELECT col_a, col_b, col_c FROM tbl_a ORDER BY col_a; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--let $OUTPUT_CHILD_GROUP2_BACKUP= $OUTPUT_CHILD_GROUP2 +--let $OUTPUT_CHILD_GROUP2= 1 +--let $USE_GENERAL_LOG_BACKUP= $USE_GENERAL_LOG +--let $USE_GENERAL_LOG= 1 diff --git a/storage/spider/mysql-test/spider/t/direct_join.test b/storage/spider/mysql-test/spider/t/direct_join.test new file mode 100644 index 00000000000..680164006c8 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_join.test @@ -0,0 +1,197 @@ +--source ../include/direct_join_init.inc + +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + if ($USE_GENERAL_LOG) + { + 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; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo create table and insert +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES6; + echo CHILD2_1_DROP_TABLES5; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES5; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES5; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +--enable_warnings +--disable_query_log +echo 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; +eval 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; +echo 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; +eval 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; +echo 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; +eval 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; +--enable_query_log +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); + +--echo +--echo select test +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +SELECT a.a, c.b, c.c FROM tbl_a a, tbl_b b, tbl_c c WHERE a.a = b.a and a.a = c.a ORDER BY a.b DESC LIMIT 1,2; + +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_1_SELECT_ARGUMENT1; + } + eval $CHILD2_1_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } +} +--enable_warnings +--source ../include/direct_join_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/partition_cond_push.test b/storage/spider/mysql-test/spider/t/partition_cond_push.test new file mode 100644 index 00000000000..4bcfc2aa386 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/partition_cond_push.test @@ -0,0 +1,219 @@ +--source ../include/partition_cond_push_init.inc +if (!$HAVE_PARTITION) +{ + --source ../include/partition_cond_push_deinit.inc + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + if ($USE_GENERAL_LOG) + { + 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; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +--enable_warnings + +--echo +--echo create table and insert +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + value int NOT NULL +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + value int NOT NULL +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +INSERT INTO tbl_a (value) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (value) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (value) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +--echo +--echo select test +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +SELECT value FROM tbl_a WHERE value < 100; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_1_SELECT_ARGUMENT1; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_2_SELECT_ARGUMENT1; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_3_SELECT_ARGUMENT1; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } +} +--enable_warnings +--source ../include/partition_cond_push_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/partition_fulltext.test b/storage/spider/mysql-test/spider/t/partition_fulltext.test new file mode 100644 index 00000000000..cd9f9b05e9d --- /dev/null +++ b/storage/spider/mysql-test/spider/t/partition_fulltext.test @@ -0,0 +1,223 @@ +--source ../include/partition_fulltext_init.inc +if (!$HAVE_PARTITION) +{ + --source ../include/partition_fulltext_deinit.inc + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + if ($USE_GENERAL_LOG) + { + 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; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +--enable_warnings + +--echo +--echo create table and insert +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + words text NOT NULL, + PRIMARY KEY (pkey), + FULLTEXT (words) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + words text NOT NULL, + PRIMARY KEY (pkey), + FULLTEXT (words) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +INSERT INTO tbl_a (pkey, words) VALUES (0, 'abc'),(1, 'def'),(2, 'ghi'),(3, 'jkl'),(4, 'mno'),(5, 'pqr'),(6, 'stu'),(7, 'vwx'); + +--echo +--echo select test +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +SELECT pkey, words FROM tbl_a WHERE match(words) against('+ghi' in boolean mode); +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_1_SELECT_ARGUMENT1; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_2_SELECT_ARGUMENT1; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_3_SELECT_ARGUMENT1; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } +} +--enable_warnings +--source ../include/partition_fulltext_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test b/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test new file mode 100644 index 00000000000..f4e155be5e2 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/partition_join_pushdown_for_single_partition.test @@ -0,0 +1,222 @@ +--source ../include/partition_join_pushdown_for_single_partition_init.inc +if (!$HAVE_PARTITION) +{ + --source ../include/partition_join_pushdown_for_single_partition_deinit.inc + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + if ($USE_GENERAL_LOG) + { + 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; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +--enable_warnings + +--echo +--echo create table and insert +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_DROP_TABLES2; + echo CHILD2_2_CREATE_TABLES; + echo CHILD2_2_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + eval $CHILD2_2_DROP_TABLES2; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + eval $CHILD2_2_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_DROP_TABLES2; + echo CHILD2_3_CREATE_TABLES; + echo CHILD2_3_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + eval $CHILD2_3_DROP_TABLES2; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + eval $CHILD2_3_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + value int NOT NULL, + PRIMARY KEY(value) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + value int NOT NULL, + PRIMARY KEY(value) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +echo CREATE TABLE tbl_b ( + value2 int NOT NULL, + PRIMARY KEY(value2) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; +eval CREATE TABLE tbl_b ( + value2 int NOT NULL, + PRIMARY KEY(value2) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +--enable_query_log + +insert into tbl_a values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +insert into tbl_b values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); + +--connection master_1 +SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = b.value2 AND a.value = 5; +SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = 5 and b.value2 = 5; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_1_SELECT_ARGUMENT1; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_2_SELECT_ARGUMENT1; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + eval $CHILD2_3_SELECT_ARGUMENT1; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } +} +--enable_warnings +--source ../include/partition_join_pushdown_for_single_partition_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/partition_mrr.test b/storage/spider/mysql-test/spider/t/partition_mrr.test new file mode 100644 index 00000000000..e7fedce33e6 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/partition_mrr.test @@ -0,0 +1,235 @@ +--source ../include/partition_mrr_init.inc +if (!$HAVE_PARTITION) +{ + --source ../include/partition_mrr_deinit.inc + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + if ($USE_GENERAL_LOG) + { + 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; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SET @old_log_output = @@global.log_output; + SET GLOBAL log_output = 'TABLE,FILE'; + } + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +--enable_warnings + +--echo +--echo create table and insert +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +DROP TABLE IF EXISTS tbl_b; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +echo CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_b ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2; +--enable_query_log +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); +INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19); +INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29); + +--echo +--echo select test +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ + eval $CHILD2_1_SELECT_ARGUMENT1; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ + eval $CHILD2_2_SELECT_ARGUMENT1; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ + eval $CHILD2_3_SELECT_ARGUMENT1; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + if ($USE_GENERAL_LOG) + { + SET GLOBAL log_output = @old_log_output; + } +} +--enable_warnings +--source ../include/partition_mrr_deinit.inc +--echo +--echo end of test |