From c0d75a6d2642ceb4e81e6a1efb9d127db2a56fc4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 28 Oct 2018 11:07:18 +0100 Subject: spider.show_system_tables: make the result stable --- .../mysql-test/spider/r/show_system_tables.result | 20 ++++++++++---------- .../mysql-test/spider/t/show_system_tables.test | 7 ++----- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/r/show_system_tables.result b/storage/spider/mysql-test/spider/r/show_system_tables.result index 39c3953b73d..67411862e00 100644 --- a/storage/spider/mysql-test/spider/r/show_system_tables.result +++ b/storage/spider/mysql-test/spider/r/show_system_tables.result @@ -10,18 +10,18 @@ child3_3 Show system tables on the Spider node connection master_1; -SELECT table_name, engine FROM information_schema.tables -WHERE table_schema = 'mysql' AND table_name like '%spider_%' +SELECT table_name, engine FROM information_schema.tables +WHERE table_schema = 'mysql' AND table_name like '%spider_%'; table_name engine -spider_xa_member Aria -spider_xa_failed_log Aria -spider_xa Aria -spider_tables Aria -spider_table_sts Aria -spider_table_position_for_recovery Aria -spider_table_crd Aria -spider_link_mon_servers Aria spider_link_failed_log Aria +spider_link_mon_servers Aria +spider_table_crd Aria +spider_table_position_for_recovery Aria +spider_table_sts Aria +spider_tables Aria +spider_xa Aria +spider_xa_failed_log Aria +spider_xa_member Aria deinit for master_1 diff --git a/storage/spider/mysql-test/spider/t/show_system_tables.test b/storage/spider/mysql-test/spider/t/show_system_tables.test index fd8451a2a60..ae8259b01bc 100644 --- a/storage/spider/mysql-test/spider/t/show_system_tables.test +++ b/storage/spider/mysql-test/spider/t/show_system_tables.test @@ -9,12 +9,9 @@ --echo --echo Show system tables on the Spider node --connection master_1 ---disable_query_log -echo SELECT table_name, engine FROM information_schema.tables - WHERE table_schema = 'mysql' AND table_name like '%spider_%'; -eval SELECT table_name, engine FROM information_schema.tables +--sorted_result +SELECT table_name, engine FROM information_schema.tables WHERE table_schema = 'mysql' AND table_name like '%spider_%'; ---enable_query_log --echo --echo deinit -- cgit v1.2.1 From 6caf9ec425a12ed54741cdf4c4a238c45cabd898 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Tue, 20 Nov 2018 00:12:58 +0900 Subject: Update Spider to version 3.3.14. Add direct left outer join/right outer join/inner join feature --- .../spider/include/direct_join_using_deinit.inc | 9 + .../spider/include/direct_join_using_init.inc | 13 ++ .../spider/include/direct_left_join_deinit.inc | 9 + .../spider/include/direct_left_join_init.inc | 13 ++ .../include/direct_left_join_nullable_deinit.inc | 9 + .../include/direct_left_join_nullable_init.inc | 13 ++ .../direct_left_right_join_nullable_deinit.inc | 9 + .../direct_left_right_join_nullable_init.inc | 13 ++ ...direct_left_right_left_join_nullable_deinit.inc | 9 + .../direct_left_right_left_join_nullable_init.inc | 13 ++ .../spider/include/direct_right_join_deinit.inc | 9 + .../spider/include/direct_right_join_init.inc | 13 ++ .../include/direct_right_join_nullable_deinit.inc | 9 + .../include/direct_right_join_nullable_init.inc | 13 ++ .../direct_right_left_join_nullable_deinit.inc | 9 + .../direct_right_left_join_nullable_init.inc | 13 ++ ...irect_right_left_right_join_nullable_deinit.inc | 9 + .../direct_right_left_right_join_nullable_init.inc | 13 ++ .../mysql-test/spider/include/init_spider.inc | 42 +++- .../mysql-test/spider/r/direct_join_using.result | 108 +++++++++++ .../mysql-test/spider/r/direct_left_join.result | 108 +++++++++++ .../spider/r/direct_left_join_nullable.result | 113 +++++++++++ .../r/direct_left_right_join_nullable.result | 113 +++++++++++ .../r/direct_left_right_left_join_nullable.result | 112 +++++++++++ .../mysql-test/spider/r/direct_right_join.result | 108 +++++++++++ .../spider/r/direct_right_join_nullable.result | 113 +++++++++++ .../r/direct_right_left_join_nullable.result | 112 +++++++++++ .../r/direct_right_left_right_join_nullable.result | 113 +++++++++++ .../mysql-test/spider/r/show_system_tables.result | 37 ++++ .../mysql-test/spider/t/direct_join_using.test | 197 +++++++++++++++++++ .../mysql-test/spider/t/direct_left_join.test | 197 +++++++++++++++++++ .../spider/t/direct_left_join_nullable.test | 212 +++++++++++++++++++++ .../spider/t/direct_left_right_join_nullable.test | 212 +++++++++++++++++++++ .../t/direct_left_right_left_join_nullable.test | 212 +++++++++++++++++++++ .../mysql-test/spider/t/direct_right_join.test | 197 +++++++++++++++++++ .../spider/t/direct_right_join_nullable.test | 212 +++++++++++++++++++++ .../spider/t/direct_right_left_join_nullable.test | 212 +++++++++++++++++++++ .../t/direct_right_left_right_join_nullable.test | 212 +++++++++++++++++++++ .../mysql-test/spider/t/show_system_tables.test | 26 +++ 39 files changed, 3157 insertions(+), 9 deletions(-) create mode 100644 storage/spider/mysql-test/spider/include/direct_join_using_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_join_using_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/r/direct_join_using.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_join.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_join.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/show_system_tables.result create mode 100644 storage/spider/mysql-test/spider/t/direct_join_using.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_join.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_join.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/show_system_tables.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/direct_join_using_deinit.inc b/storage/spider/mysql-test/spider/include/direct_join_using_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_join_using_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_using_init.inc b/storage/spider/mysql-test/spider/include/direct_join_using_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_join_using_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/direct_left_join_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_join_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_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_left_join_init.inc b/storage/spider/mysql-test/spider/include/direct_left_join_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_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/direct_left_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_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_left_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_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/direct_left_right_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_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_left_right_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_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/direct_left_right_left_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_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_left_right_left_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_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/direct_right_join_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_join_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_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_right_join_init.inc b/storage/spider/mysql-test/spider/include/direct_right_join_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_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/direct_right_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_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_right_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_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/direct_right_left_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_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_right_left_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_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/direct_right_left_right_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_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_right_left_right_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_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 c4d171d418e..1da1ec970b5 100644 --- a/storage/spider/mysql-test/spider/include/init_spider.inc +++ b/storage/spider/mysql-test/spider/include/init_spider.inc @@ -103,10 +103,17 @@ if (!$VERSION_COMPILE_OS_WIN) ); } +let $SERVER_NAME= + `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '-', 2), '-', -1)`; +let $SERVER_MAJOR_VERSION= + `SELECT SUBSTRING_INDEX(version(), '.', 1)`; +let $SERVER_MINOR_VERSION= + `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(version(), '.', 2), '.', -1)`; let $PLUGIN_VERSION= `SELECT SUBSTRING_INDEX(plugin_version, '.', 1) FROM information_schema.plugins WHERE plugin_name = 'SPIDER'`; + if (`SELECT IF($PLUGIN_VERSION = 1, 1, 0)`) { DROP TABLE IF EXISTS mysql.spider_xa; @@ -245,7 +252,16 @@ if (`SELECT IF($PLUGIN_VERSION = 2, 1, 0)`) } if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) { + let $ENGINE_NAME= + `SELECT IF (STRCMP('$SERVER_NAME', 'MariaDB') = 0, + IF ($SERVER_MAJOR_VERSION = 10, + IF ($SERVER_MINOR_VERSION < 4, 'MyISAM', + 'Aria transactional=1'), + IF ($SERVER_MAJOR_VERSION < 10, 'MyISAM', + 'Aria transactional=1')), + 'MyISAM')`; DROP TABLE IF EXISTS mysql.spider_xa; + eval CREATE TABLE mysql.spider_xa( format_id int not null default 0, gtrid_length int not null default 0, @@ -254,8 +270,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) status char(8) not null default '', PRIMARY KEY (data, format_id, gtrid_length), KEY idx1 (status) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_xa_member; + eval CREATE TABLE mysql.spider_xa_member( format_id int not null default 0, gtrid_length int not null default 0, @@ -276,8 +293,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) default_file text default null, default_group char(64) default null, KEY idx1 (data, format_id, gtrid_length, host) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_xa_failed_log; + eval CREATE TABLE mysql.spider_xa_failed_log( format_id int not null default 0, gtrid_length int not null default 0, @@ -301,8 +319,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) 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; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_tables; + eval CREATE TABLE mysql.spider_tables( db_name char(64) not null default '', table_name char(199) not null default '', @@ -332,8 +351,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) PRIMARY KEY (db_name, table_name, link_id), KEY idx1 (priority), UNIQUE KEY uidx1 (db_name, table_name, static_link_id) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_link_mon_servers; + eval CREATE TABLE mysql.spider_link_mon_servers( db_name char(64) not null default '', table_name char(199) not null default '', @@ -355,15 +375,17 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) default_file text default null, default_group char(64) default null, PRIMARY KEY (db_name, table_name, link_id, sid) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_link_failed_log; + eval CREATE TABLE mysql.spider_link_failed_log( db_name char(64) not null default '', table_name char(199) not null default '', link_id char(64) not null default '', failed_time timestamp not null default current_timestamp - ) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; + eval CREATE TABLE mysql.spider_table_position_for_recovery( db_name char(64) not null default '', table_name char(199) not null default '', @@ -373,8 +395,9 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) position text, gtid text, primary key (db_name, table_name, failed_link_id, source_link_id) - ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_table_sts; + eval CREATE TABLE mysql.spider_table_sts( db_name char(64) not null default '', table_name char(199) not null default '', @@ -387,15 +410,16 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) 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; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS mysql.spider_table_crd; + eval 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; + ) ENGINE=$ENGINE_NAME DEFAULT CHARSET=utf8 COLLATE=utf8_bin; } SET spider_internal_sql_log_off= 0; diff --git a/storage/spider/mysql-test/spider/r/direct_join_using.result b/storage/spider/mysql-test/spider/r/direct_join_using.result new file mode 100644 index 00000000000..66ae1503f9f --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_join_using.result @@ -0,0 +1,108 @@ +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 join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC; +a b c +5 50 500 +4 40 400 +3 30 300 +2 20 200 +1 10 100 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE 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 +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_left_join.result b/storage/spider/mysql-test/spider/r/direct_left_join.result new file mode 100644 index 00000000000..b63f0661b2e --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_join.result @@ -0,0 +1,108 @@ +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 left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC; +a b c +5 50 500 +4 40 400 +3 30 300 +2 20 200 +1 10 100 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r` t0 left join `auto_test_remote`.`ta_r_3` t1 on (t1.`a` = t0.`a`) left join `auto_test_remote`.`ta_r_int` t2 on (t2.`a` = t0.`a`) where 1 order by t0.`b` desc +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_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result new file mode 100644 index 00000000000..e646bc9bf38 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC; +a b c a +5 NULL NULL NULL +4 NULL NULL NULL +3 c 2000-01-03 00:00:00 NULL +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t0 left join `auto_test_remote`.`ta_r_auto_inc` t1 on ((t1.`a` = t0.`a`) and (t0.`a` is not null)) left join `auto_test_remote`.`ta_r_3` t2 on (t2.`c` = t1.`c`) left join `auto_test_remote`.`ta_r` t3 on ((t3.`b` = t2.`b`) and (t2.`b` is not null)) where 1 order by t0.`a` desc +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 + +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_left_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result new file mode 100644 index 00000000000..f3c6e189444 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL NULL NULL 5 +NULL NULL NULL 4 +NULL NULL NULL 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 join `auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r` t0) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null) and (t3.`b` is not null)) where 1 order by t3.`a` desc +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 + +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_left_right_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result new file mode 100644 index 00000000000..88205fb0f65 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result @@ -0,0 +1,112 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL d 2000-01-04 00:00:00 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_auto_inc` t2 left join (`auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r` t0) on ((t1.`c` = t2.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null)) left join `auto_test_remote`.`ta_r_no_idx` t3 on (t3.`b` = t2.`b`) where 1 order by t3.`a` desc +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 + +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_right_join.result b/storage/spider/mysql-test/spider/r/direct_right_join.result new file mode 100644 index 00000000000..8edfb682292 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_join.result @@ -0,0 +1,108 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +test select 1 +connection master_1; +SELECT 1; +1 +1 +connection child2_1; +SELECT 1; +1 +1 + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_DROP_TABLES6 +CHILD2_1_DROP_TABLES5 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES5 +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +CREATE TABLE tbl_b ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1 +CREATE TABLE tbl_c ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); +insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; +a b c +5 50 500 +4 40 400 +3 30 300 +2 20 200 +1 10 100 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r_int` t2 left join (`auto_test_remote`.`ta_r` t0 join `auto_test_remote`.`ta_r_3` t1) on ((t0.`a` = t2.`a`) and (t1.`a` = t2.`a`)) where 1 order by t0.`b` desc +SELECT argument FROM mysql.general_log WHERE 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_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result new file mode 100644 index 00000000000..a05781cb6d6 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL NULL NULL 5 +NULL d 2000-01-04 00:00:00 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join `auto_test_remote`.`ta_r_auto_inc` t2 on ((t2.`b` = t3.`b`) and (t3.`b` is not null)) left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) where 1 order by t3.`a` desc +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 + +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_right_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result new file mode 100644 index 00000000000..25e0913ba06 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result @@ -0,0 +1,112 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL d 2000-01-04 00:00:00 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_auto_inc` t2 left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) left join `auto_test_remote`.`ta_r_no_idx` t3 on (t3.`b` = t2.`b`) where 1 order by t3.`a` desc +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 + +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_right_left_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result new file mode 100644 index 00000000000..48cd9c2c75f --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL NULL NULL 5 +NULL NULL NULL 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 join `auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null))) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t3.`b` is not null)) where 1 order by t3.`a` desc +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 + +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/show_system_tables.result b/storage/spider/mysql-test/spider/r/show_system_tables.result new file mode 100644 index 00000000000..831d4578efe --- /dev/null +++ b/storage/spider/mysql-test/spider/r/show_system_tables.result @@ -0,0 +1,37 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +Show system tables on the Spider node +connection master_1; +SELECT table_name, engine FROM information_schema.tables +WHERE table_schema = 'mysql' AND table_name like '%spider_%'; +table_name engine +spider_link_failed_log MyISAM +spider_link_mon_servers MyISAM +spider_table_crd MyISAM +spider_table_position_for_recovery MyISAM +spider_table_sts MyISAM +spider_tables MyISAM +spider_xa MyISAM +spider_xa_failed_log MyISAM +spider_xa_member MyISAM + +deinit +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/t/direct_join_using.test b/storage/spider/mysql-test/spider/t/direct_join_using.test new file mode 100644 index 00000000000..819e56ff21c --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_join_using.test @@ -0,0 +1,197 @@ +--source ../include/direct_join_using_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 join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC; + +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_using_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_join.test b/storage/spider/mysql-test/spider/t/direct_left_join.test new file mode 100644 index 00000000000..e09b6a12488 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_join.test @@ -0,0 +1,197 @@ +--source ../include/direct_left_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 left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC; + +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_left_join_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test new file mode 100644 index 00000000000..dc67a01b4b2 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_left_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC; + +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_left_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test new file mode 100644 index 00000000000..9d5a990e0ba --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_left_right_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_left_right_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test new file mode 100644 index 00000000000..90e3666957d --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_left_right_left_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_left_right_left_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_join.test b/storage/spider/mysql-test/spider/t/direct_right_join.test new file mode 100644 index 00000000000..0c0496651d6 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_join.test @@ -0,0 +1,197 @@ +--source ../include/direct_right_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 right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; + +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_right_join_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test new file mode 100644 index 00000000000..3ab4a30ea84 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_right_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_right_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test new file mode 100644 index 00000000000..fefe255890d --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_right_left_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_right_left_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test new file mode 100644 index 00000000000..48882d27939 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_right_left_right_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_right_left_right_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/show_system_tables.test b/storage/spider/mysql-test/spider/t/show_system_tables.test new file mode 100644 index 00000000000..ae8259b01bc --- /dev/null +++ b/storage/spider/mysql-test/spider/t/show_system_tables.test @@ -0,0 +1,26 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings + +--echo +--echo Show system tables on the Spider node +--connection master_1 +--sorted_result +SELECT table_name, engine FROM information_schema.tables + WHERE table_schema = 'mysql' AND table_name like '%spider_%'; + +--echo +--echo deinit +--disable_warnings +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test -- cgit v1.2.1 From 3cb7c5f27bbd267e3efd69b1b312711754261801 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Tue, 20 Nov 2018 05:43:49 +0900 Subject: MDEV-16279 Spider crashes on CHECKSUM TABLE with spider_quick_mode=3 The fields of the temporary table were not created in create_tmp_table function. Because item->const_item() was true. But the temporary tables that is created by Spider are always used all columns. So Spider should call create_tmp_table function with TMP_TABLE_ALL_COLUMNS flag. --- .../checksum_table_with_quick_mode_3_deinit.inc | 14 +++ .../checksum_table_with_quick_mode_3_init.inc | 29 +++++ storage/spider/mysql-test/spider/bugfix/my.cnf | 2 + storage/spider/mysql-test/spider/bugfix/my_1_1.cnf | 44 +++++++ storage/spider/mysql-test/spider/bugfix/my_2_1.cnf | 56 +++++++++ storage/spider/mysql-test/spider/bugfix/my_2_2.cnf | 38 +++++++ storage/spider/mysql-test/spider/bugfix/my_2_3.cnf | 8 ++ storage/spider/mysql-test/spider/bugfix/my_3_1.cnf | 11 ++ storage/spider/mysql-test/spider/bugfix/my_3_2.cnf | 9 ++ storage/spider/mysql-test/spider/bugfix/my_3_3.cnf | 9 ++ storage/spider/mysql-test/spider/bugfix/my_4_1.cnf | 9 ++ .../r/checksum_table_with_quick_mode_3.result | 100 ++++++++++++++++ storage/spider/mysql-test/spider/bugfix/suite.opt | 1 + storage/spider/mysql-test/spider/bugfix/suite.pm | 12 ++ .../bugfix/t/checksum_table_with_quick_mode_3.cnf | 3 + .../bugfix/t/checksum_table_with_quick_mode_3.test | 72 ++++++++++++ .../checksum_table_with_quick_mode_3_deinit.inc | 16 +++ .../checksum_table_with_quick_mode_3_init.inc | 33 ++++++ .../r/checksum_table_with_quick_mode_3.result | 104 +++++++++++++++++ .../spider/t/checksum_table_with_quick_mode_3.test | 126 +++++++++++++++++++++ 20 files changed, 696 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/my.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_1_1.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_2_1.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_2_2.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_2_3.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_3_1.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_3_2.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_3_3.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/my_4_1.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result create mode 100644 storage/spider/mysql-test/spider/bugfix/suite.opt create mode 100644 storage/spider/mysql-test/spider/bugfix/suite.pm create mode 100644 storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test create mode 100644 storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc create mode 100644 storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result create mode 100644 storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_deinit.inc new file mode 100644 index 00000000000..47f6df9437e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_deinit.inc @@ -0,0 +1,14 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +--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/bugfix/include/checksum_table_with_quick_mode_3_init.inc b/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc new file mode 100644 index 00000000000..bf2d9163b9a --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/checksum_table_with_quick_mode_3_init.inc @@ -0,0 +1,29 @@ +--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", 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; +--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; +--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 %'; +--connection master_1 +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; diff --git a/storage/spider/mysql-test/spider/bugfix/my.cnf b/storage/spider/mysql-test/spider/bugfix/my.cnf new file mode 100644 index 00000000000..b7f76a630cc --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my.cnf @@ -0,0 +1,2 @@ +!include include/default_mysqld.cnf +!include my_1_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf b/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf new file mode 100644 index 00000000000..5f17295d895 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_1_1.cnf @@ -0,0 +1,44 @@ +[mysqld.1.1] +log-bin= master-bin +loose_handlersocket_port= 20000 +loose_handlersocket_port_wr= 20001 +loose_handlersocket_threads= 2 +loose_handlersocket_threads_wr= 1 +loose_handlersocket_support_merge_table= 0 +loose_handlersocket_direct_update_mode= 2 +loose_handlersocket_unlimited_boundary= 65536 +loose_handlersocket_bulk_insert= 0 +loose_handlersocket_bulk_insert_timeout= 0 +loose_handlersocket_general_log= 1 +loose_handlersocket_timeout= 30 +loose_handlersocket_close_table_interval=2 +open_files_limit= 4096 +loose_partition= 1 + +[ENV] +USE_GEOMETRY_TEST= 1 +USE_FULLTEXT_TEST= 1 +USE_HA_TEST= 1 +USE_GENERAL_LOG= 1 +USE_REPLICATION= 1 +MASTER_1_MYPORT= @mysqld.1.1.port +MASTER_1_HSRPORT= 20000 +MASTER_1_HSWPORT= 20001 +MASTER_1_MYSOCK= @mysqld.1.1.socket +MASTER_1_ENGINE_TYPE= Spider +#MASTER_1_ENGINE_TYPE= MyISAM +MASTER_1_ENGINE= ENGINE=Spider +MASTER_1_CHARSET= DEFAULT CHARSET=utf8 +MASTER_1_ENGINE2= ENGINE=MyISAM +MASTER_1_CHARSET2= DEFAULT CHARSET=utf8 +MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci + +STR_SEMICOLON= ; + +#The followings are set in include/init_xxx.inc files +# MASTER_1_COMMENT_2_1 +# MASTER_1_COMMENT2_2_1 +# MASTER_1_COMMENT3_2_1 +# MASTER_1_COMMENT4_2_1 +# MASTER_1_COMMENT5_2_1 +# MASTER_1_COMMENT_P_2_1 diff --git a/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf b/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf new file mode 100644 index 00000000000..24161645607 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_2_1.cnf @@ -0,0 +1,56 @@ +[mysqld.2.1] +loose_handlersocket_port= 20002 +loose_handlersocket_port_wr= 20003 +loose_handlersocket_threads= 2 +loose_handlersocket_threads_wr= 1 +loose_handlersocket_support_merge_table= 0 +loose_handlersocket_direct_update_mode= 2 +loose_handlersocket_unlimited_boundary= 65536 +loose_handlersocket_bulk_insert= 0 +loose_handlersocket_bulk_insert_timeout= 0 +loose_handlersocket_general_log= 1 +loose_handlersocket_timeout= 30 +loose_handlersocket_close_table_interval=2 +open_files_limit= 4096 + +[ENV] +USE_CHILD_GROUP2= 1 +OUTPUT_CHILD_GROUP2= 0 +CHILD2_1_MYPORT= @mysqld.2.1.port +CHILD2_1_HSRPORT= 20002 +CHILD2_1_HSWPORT= 20003 +CHILD2_1_MYSOCK= @mysqld.2.1.socket +CHILD2_1_ENGINE_TYPE= InnoDB +CHILD2_1_ENGINE= ENGINE=InnoDB +CHILD2_1_CHARSET= DEFAULT CHARSET=utf8 +CHILD2_1_CHARSET2= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci +CHILD2_1_FT_MYPORT= @mysqld.2.1.port +CHILD2_1_FT_MYSOCK= @mysqld.2.1.socket +CHILD2_1_FT_ENGINE_TYPE= MyISAM +CHILD2_1_FT_ENGINE= ENGINE=MyISAM +CHILD2_1_FT_CHARSET= DEFAULT CHARSET=utf8 +CHILD2_1_GM_MYPORT= @mysqld.2.1.port +CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket +CHILD2_1_GM_ENGINE_TYPE= MyISAM +CHILD2_1_GM_ENGINE= ENGINE=MyISAM +CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8 + +#The followings are set in include/init_xxx.inc files +# CHILD2_1_DROP_TABLES +# CHILD2_1_CREATE_TABLES +# CHILD2_1_SELECT_TABLES +# CHILD2_1_DROP_TABLES2 +# CHILD2_1_CREATE_TABLES2 +# CHILD2_1_SELECT_TABLES2 +# CHILD2_1_DROP_TABLES3 +# CHILD2_1_CREATE_TABLES3 +# CHILD2_1_SELECT_TABLES3 +# CHILD2_1_DROP_TABLES4 +# CHILD2_1_CREATE_TABLES4 +# CHILD2_1_SELECT_TABLES4 +# CHILD2_1_DROP_TABLES5 +# CHILD2_1_CREATE_TABLES5 +# CHILD2_1_SELECT_TABLES5 +# CHILD2_1_DROP_TABLES6 +# CHILD2_1_CREATE_TABLES6 +# CHILD2_1_SELECT_TABLES6 diff --git a/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf b/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf new file mode 100644 index 00000000000..2d3c2a89a7d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_2_2.cnf @@ -0,0 +1,38 @@ +[mysqld.2.2] +loose_handlersocket_port= 20004 +loose_handlersocket_port_wr= 20005 +loose_handlersocket_threads= 2 +loose_handlersocket_threads_wr= 1 +loose_handlersocket_support_merge_table= 0 +loose_handlersocket_direct_update_mode= 2 +loose_handlersocket_unlimited_boundary= 65536 +loose_handlersocket_bulk_insert= 0 +loose_handlersocket_bulk_insert_timeout= 0 +loose_handlersocket_general_log= 1 +loose_handlersocket_timeout= 30 +loose_handlersocket_close_table_interval=2 +open_files_limit= 4096 + +[ENV] +CHILD2_2_MYPORT= @mysqld.2.2.port +CHILD2_2_HSRPORT= 20004 +CHILD2_2_HSWPORT= 20005 +CHILD2_2_MYSOCK= @mysqld.2.2.socket +CHILD2_2_ENGINE_TYPE= InnoDB +CHILD2_2_ENGINE= ENGINE=InnoDB +CHILD2_2_CHARSET= DEFAULT CHARSET=utf8 +CHILD2_2_FT_MYPORT= @mysqld.2.2.port +CHILD2_2_FT_MYSOCK= @mysqld.2.2.socket +CHILD2_2_FT_ENGINE_TYPE= MyISAM +CHILD2_2_FT_ENGINE= ENGINE=MyISAM +CHILD2_2_FT_CHARSET= DEFAULT CHARSET=utf8 +CHILD2_2_GM_MYPORT= @mysqld.2.2.port +CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket +CHILD2_2_GM_ENGINE_TYPE= MyISAM +CHILD2_2_GM_ENGINE= ENGINE=MyISAM +CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8 + +#The followings are set in include/init_xxx.inc files +# CHILD2_2_DROP_TABLES +# CHILD2_2_CREATE_TABLES +# CHILD2_2_SELECT_TABLES diff --git a/storage/spider/mysql-test/spider/bugfix/my_2_3.cnf b/storage/spider/mysql-test/spider/bugfix/my_2_3.cnf new file mode 100644 index 00000000000..024da651e0c --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_2_3.cnf @@ -0,0 +1,8 @@ +[mysqld.2.3] + +[ENV] +CHILD2_3_MYPORT= @mysqld.2.3.port +CHILD2_3_MYSOCK= @mysqld.2.3.socket +CHILD2_3_ENGINE_TYPE= InnoDB +CHILD2_3_ENGINE= ENGINE=InnoDB +CHILD2_3_CHARSET= DEFAULT CHARSET=utf8 diff --git a/storage/spider/mysql-test/spider/bugfix/my_3_1.cnf b/storage/spider/mysql-test/spider/bugfix/my_3_1.cnf new file mode 100644 index 00000000000..fad21607789 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_3_1.cnf @@ -0,0 +1,11 @@ +[mysqld.3.1] +loose_partition= 1 + +[ENV] +USE_CHILD_GROUP3= 1 +OUTPUT_CHILD_GROUP3= 0 +CHILD3_1_MYPORT= @mysqld.3.1.port +CHILD3_1_MYSOCK= @mysqld.3.1.socket +CHILD3_1_ENGINE_TYPE= InnoDB +CHILD3_1_ENGINE= ENGINE=InnoDB +CHILD3_1_CHARSET= DEFAULT CHARSET=utf8 diff --git a/storage/spider/mysql-test/spider/bugfix/my_3_2.cnf b/storage/spider/mysql-test/spider/bugfix/my_3_2.cnf new file mode 100644 index 00000000000..6f027b6f525 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_3_2.cnf @@ -0,0 +1,9 @@ +[mysqld.3.2] +loose_partition= 1 + +[ENV] +CHILD3_2_MYPORT= @mysqld.3.2.port +CHILD3_2_MYSOCK= @mysqld.3.2.socket +CHILD3_2_ENGINE_TYPE= InnoDB +CHILD3_2_ENGINE= ENGINE=InnoDB +CHILD3_2_CHARSET= DEFAULT CHARSET=utf8 diff --git a/storage/spider/mysql-test/spider/bugfix/my_3_3.cnf b/storage/spider/mysql-test/spider/bugfix/my_3_3.cnf new file mode 100644 index 00000000000..fbb33694738 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_3_3.cnf @@ -0,0 +1,9 @@ +[mysqld.3.3] +loose_partition= 1 + +[ENV] +CHILD3_3_MYPORT= @mysqld.3.3.port +CHILD3_3_MYSOCK= @mysqld.3.3.socket +CHILD3_3_ENGINE_TYPE= InnoDB +CHILD3_3_ENGINE= ENGINE=InnoDB +CHILD3_3_CHARSET= DEFAULT CHARSET=utf8 diff --git a/storage/spider/mysql-test/spider/bugfix/my_4_1.cnf b/storage/spider/mysql-test/spider/bugfix/my_4_1.cnf new file mode 100644 index 00000000000..d1812a48b68 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/my_4_1.cnf @@ -0,0 +1,9 @@ +[mysqld.4.1] +loose_partition= 1 + +[ENV] +SLAVE1_1_MYPORT= @mysqld.4.1.port +SLAVE1_1_MYSOCK= @mysqld.4.1.socket +SLAVE1_1_ENGINE_TYPE= MyISAM +SLAVE1_1_ENGINE= ENGINE=MyISAM +SLAVE1_1_CHARSET= DEFAULT CHARSET=utf8 diff --git a/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result new file mode 100644 index 00000000000..eae4895411e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/checksum_table_with_quick_mode_3.result @@ -0,0 +1,100 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; + +this test is for MDEV-16279 + +drop and create databases +connection master_1; +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +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); +FLUSH TABLES; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +CHECKSUM TABLE tbl_a EXTENDED; +Table Checksum +auto_test_local.tbl_a 1061386331 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote`.`tbl_a` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/suite.opt b/storage/spider/mysql-test/spider/bugfix/suite.opt new file mode 100644 index 00000000000..672a3b37d4f --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/suite.opt @@ -0,0 +1 @@ +--loose-innodb --loose-skip-performance-schema diff --git a/storage/spider/mysql-test/spider/bugfix/suite.pm b/storage/spider/mysql-test/spider/bugfix/suite.pm new file mode 100644 index 00000000000..f106147deb6 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/suite.pm @@ -0,0 +1,12 @@ +package My::Suite::Spider; + +@ISA = qw(My::Suite); + +return "No Spider engine" unless $ENV{HA_SPIDER_SO}; +return "Not run for embedded server" if $::opt_embedded_server; +return "Test needs --big-test" unless $::opt_big_test; + +sub is_default { 1 } + +bless { }; + diff --git a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test new file mode 100644 index 00000000000..5dc4a88c842 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/checksum_table_with_quick_mode_3.test @@ -0,0 +1,72 @@ +--source ../include/checksum_table_with_quick_mode_3_init.inc +--echo +--echo this test is for MDEV-16279 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--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; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--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); +FLUSH TABLES; + +--echo +--echo select test 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +CHECKSUM TABLE tbl_a EXTENDED; + +--connection child2_1 +eval $CHILD2_1_SELECT_ARGUMENT1; +eval $CHILD2_1_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings + +--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; + +--enable_warnings +--source ../include/checksum_table_with_quick_mode_3_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc new file mode 100644 index 00000000000..d551f5a4af3 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc @@ -0,0 +1,16 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +--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/checksum_table_with_quick_mode_3_init.inc b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc new file mode 100644 index 00000000000..9ec61a1cb77 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc @@ -0,0 +1,33 @@ +--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", 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; +--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; +--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 $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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; diff --git a/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result new file mode 100644 index 00000000000..ee8e1f056f3 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result @@ -0,0 +1,104 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; + +drop and create databases +connection master_1; +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +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); +FLUSH TABLES; + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +CHECKSUM TABLE tbl_a EXTENDED; +Table Checksum +auto_test_local.tbl_a 1061386331 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote`.`tbl_a` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +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/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test new file mode 100644 index 00000000000..d108fda7e41 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test @@ -0,0 +1,126 @@ +--source ../include/checksum_table_with_quick_mode_3_init.inc +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +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'; + } + CREATE DATABASE auto_test_remote; + USE auto_test_remote; +} +--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_CREATE_TABLES; + } + 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_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; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--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); +FLUSH TABLES; + +--echo +--echo select test 1 +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 +CHECKSUM TABLE tbl_a EXTENDED; +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/checksum_table_with_quick_mode_3_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From bef6b197fc2555be357642ec81851d240eec5aa7 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Fri, 30 Nov 2018 03:17:08 +0900 Subject: MDEV-16520 Out-Of-Memory running big aggregate query on Spider Engine Change default value of the followings quick_mode 0 -> 3 quick_page_size 100 -> 1024 Add the following parameter for limiting result page size by byte - quick_page_byte(qpb) Number of bytes in a page when acquisition one by one. When quick_mode is 1 or 2, Spider stores at least 1 record even if quick_page_byte is smaller than 1 record. When quick_mode is 3, quick_page_byte is used for judging using temporary table. That is given to priority when server parameter spider_quick_page_byte is set. The default value is 10485760 Fix "out of sync" issue at using quick_mode = 1 or 2 --- .../spider/include/quick_mode_0_deinit.inc | 21 + .../spider/include/quick_mode_0_init.inc | 55 +++ .../spider/include/quick_mode_1_deinit.inc | 21 + .../spider/include/quick_mode_1_init.inc | 55 +++ .../spider/include/quick_mode_2_deinit.inc | 21 + .../spider/include/quick_mode_2_init.inc | 55 +++ .../spider/include/quick_mode_3_deinit.inc | 21 + .../spider/include/quick_mode_3_init.inc | 55 +++ .../spider/mysql-test/spider/r/quick_mode_0.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/r/quick_mode_1.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/r/quick_mode_2.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/r/quick_mode_3.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/t/quick_mode_0.test | 309 +++++++++++++ .../spider/mysql-test/spider/t/quick_mode_1.test | 309 +++++++++++++ .../spider/mysql-test/spider/t/quick_mode_2.test | 309 +++++++++++++ .../spider/mysql-test/spider/t/quick_mode_3.test | 309 +++++++++++++ 16 files changed, 3600 insertions(+) create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_0_init.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_1_init.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_2_init.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_3_init.inc create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_0.result create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_1.result create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_2.result create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_3.result create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_0.test create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_1.test create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_2.test create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_3.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_0_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_0_init.inc new file mode 100644 index 00000000000..92afb3bf10b --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_0_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 0; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_1_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_1_init.inc new file mode 100644 index 00000000000..cc5a847fdc0 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_1_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 1; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_2_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_2_init.inc new file mode 100644 index 00000000000..3a16bb1dc63 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_2_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 2; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_3_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_3_init.inc new file mode 100644 index 00000000000..df7d713c4c7 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_3_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/r/quick_mode_0.result b/storage/spider/mysql-test/spider/r/quick_mode_0.result new file mode 100644 index 00000000000..1cf79124b8c --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_0.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 0; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/quick_mode_1.result b/storage/spider/mysql-test/spider/r/quick_mode_1.result new file mode 100644 index 00000000000..1d56cff3e36 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_1.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 1; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/quick_mode_2.result b/storage/spider/mysql-test/spider/r/quick_mode_2.result new file mode 100644 index 00000000000..5b0cd75af34 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_2.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 2; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/quick_mode_3.result b/storage/spider/mysql-test/spider/r/quick_mode_3.result new file mode 100644 index 00000000000..4261cde2e36 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_3.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/t/quick_mode_0.test b/storage/spider/mysql-test/spider/t/quick_mode_0.test new file mode 100644 index 00000000000..ffb665c0604 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_0.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_0_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/quick_mode_1.test b/storage/spider/mysql-test/spider/t/quick_mode_1.test new file mode 100644 index 00000000000..70d61d087e3 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_1.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_1_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/quick_mode_2.test b/storage/spider/mysql-test/spider/t/quick_mode_2.test new file mode 100644 index 00000000000..71e7b0338dc --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_2.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_2_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_2_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/quick_mode_3.test b/storage/spider/mysql-test/spider/t/quick_mode_3.test new file mode 100644 index 00000000000..000edd4fdff --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_3.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_3_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_3_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From 6d80d35d9161287e6e72ac728338473c96f9fb22 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Thu, 13 Dec 2018 03:11:57 +0900 Subject: MDEV-16787 optimistic parallel replication fails on spider Add a system variable spider_slave_trx_isolation. - spider_slave_trx_isolation The transaction isolation level when Spider table is used by slave SQL thread. -1 : OFF 0 : READ UNCOMMITTED 1 : READ COMMITTED 2 : REPEATABLE READ 3 : SERIALIZABLE The default value is -1 Miscellaneous Spider typos --- .../spider/include/slave_trx_isolation_deinit.inc | 17 +++ .../spider/include/slave_trx_isolation_init.inc | 39 +++++ .../mysql-test/spider/r/slave_trx_isolation.result | 110 ++++++++++++++ .../mysql-test/spider/t/slave_trx_isolation.test | 166 +++++++++++++++++++++ 4 files changed, 332 insertions(+) create mode 100644 storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc create mode 100644 storage/spider/mysql-test/spider/r/slave_trx_isolation.result create mode 100644 storage/spider/mysql-test/spider/t/slave_trx_isolation.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc b/storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc new file mode 100644 index 00000000000..e5f585e5cca --- /dev/null +++ b/storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc @@ -0,0 +1,17 @@ +--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 +--connection slave1_1 +set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation; +--disable_warnings +--disable_query_log +--disable_result_log +--source ../include/deinit_spider.inc +--source ../t/slave_test_deinit.inc +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc b/storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc new file mode 100644 index 00000000000..94ccf1d3295 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc @@ -0,0 +1,39 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--source ../t/slave_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", 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; +--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; +--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 '%set %'; +--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 slave1_1 +--disable_warnings +--disable_query_log +--disable_result_log +--source ../include/init_spider.inc +--enable_result_log +--enable_query_log +--enable_warnings +set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation; +set global spider_slave_trx_isolation= 1; diff --git a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result new file mode 100644 index 00000000000..167739beaad --- /dev/null +++ b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result @@ -0,0 +1,110 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 +connection slave1_1; +set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation; +set global spider_slave_trx_isolation= 1; + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection slave1_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; + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +connection slave1_1; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +connection master_1; +SET SESSION sql_log_bin= 1; +connection slave1_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +connection master_1; +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +connection slave1_1; +connection master_1; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %'; +argument +set session time_zone = '+00:00' +SET NAMES utf8 +set session transaction isolation level read committed;set session autocommit = 1;start transaction +SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +connection slave1_1; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection slave1_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 slave1_1; +set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation; +for slave1_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/t/slave_trx_isolation.test b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test new file mode 100644 index 00000000000..d1dea8546b9 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test @@ -0,0 +1,166 @@ +--source ../include/slave_trx_isolation_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_REPLICATION) +{ + --connection slave1_1 + 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 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; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +if ($USE_REPLICATION) +{ + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log +} +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +--connection master_1 +if ($USE_REPLICATION) +{ + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS tbl_a; + --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; + eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; + --enable_query_log + --connection master_1 +} +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +if ($USE_REPLICATION) +{ + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log +} +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 + } +} +if ($USE_REPLICATION) +{ + --connection slave1_1 + SELECT pkey FROM tbl_a ORDER BY pkey; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_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/slave_trx_isolation_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From be556f817b88139502dd75cdbf22a28c2fe5806c Mon Sep 17 00:00:00 2001 From: Kentoku Date: Mon, 24 Dec 2018 23:40:33 +0900 Subject: remove unnecessary drop database/table from quick_mode.test add simplified quick_mode.test --- .../spider/bugfix/include/quick_mode_0_deinit.inc | 19 + .../spider/bugfix/include/quick_mode_0_init.inc | 51 +++ .../spider/bugfix/include/quick_mode_1_deinit.inc | 19 + .../spider/bugfix/include/quick_mode_1_init.inc | 51 +++ .../spider/bugfix/include/quick_mode_2_deinit.inc | 19 + .../spider/bugfix/include/quick_mode_2_init.inc | 51 +++ .../spider/bugfix/include/quick_mode_3_deinit.inc | 19 + .../spider/bugfix/include/quick_mode_3_init.inc | 51 +++ .../mysql-test/spider/bugfix/r/quick_mode_0.result | 504 +++++++++++++++++++++ .../mysql-test/spider/bugfix/r/quick_mode_1.result | 504 +++++++++++++++++++++ .../mysql-test/spider/bugfix/r/quick_mode_2.result | 504 +++++++++++++++++++++ .../mysql-test/spider/bugfix/r/quick_mode_3.result | 504 +++++++++++++++++++++ .../mysql-test/spider/bugfix/t/quick_mode_0.cnf | 4 + .../mysql-test/spider/bugfix/t/quick_mode_0.test | 156 +++++++ .../mysql-test/spider/bugfix/t/quick_mode_1.cnf | 4 + .../mysql-test/spider/bugfix/t/quick_mode_1.test | 156 +++++++ .../mysql-test/spider/bugfix/t/quick_mode_2.cnf | 4 + .../mysql-test/spider/bugfix/t/quick_mode_2.test | 156 +++++++ .../mysql-test/spider/bugfix/t/quick_mode_3.cnf | 4 + .../mysql-test/spider/bugfix/t/quick_mode_3.test | 157 +++++++ .../spider/mysql-test/spider/r/quick_mode_0.result | 7 - .../spider/mysql-test/spider/r/quick_mode_1.result | 7 - .../spider/mysql-test/spider/r/quick_mode_2.result | 7 - .../spider/mysql-test/spider/r/quick_mode_3.result | 7 - .../spider/mysql-test/spider/t/quick_mode_0.test | 15 - .../spider/mysql-test/spider/t/quick_mode_1.test | 15 - .../spider/mysql-test/spider/t/quick_mode_2.test | 15 - .../spider/mysql-test/spider/t/quick_mode_3.test | 15 - 28 files changed, 2937 insertions(+), 88 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result create mode 100644 storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result create mode 100644 storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result create mode 100644 storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_deinit.inc new file mode 100644 index 00000000000..42124a794ea --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_deinit.inc @@ -0,0 +1,19 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/bugfix/include/quick_mode_0_init.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_init.inc new file mode 100644 index 00000000000..2656517216c --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_0_init.inc @@ -0,0 +1,51 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--connection master_1 +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 0; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_deinit.inc new file mode 100644 index 00000000000..42124a794ea --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_deinit.inc @@ -0,0 +1,19 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/bugfix/include/quick_mode_1_init.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_init.inc new file mode 100644 index 00000000000..9a8de407569 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_1_init.inc @@ -0,0 +1,51 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--connection master_1 +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 1; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_deinit.inc new file mode 100644 index 00000000000..42124a794ea --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_deinit.inc @@ -0,0 +1,19 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/bugfix/include/quick_mode_2_init.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_init.inc new file mode 100644 index 00000000000..dbe3f703a2f --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_2_init.inc @@ -0,0 +1,51 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--connection master_1 +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 2; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_deinit.inc new file mode 100644 index 00000000000..42124a794ea --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_deinit.inc @@ -0,0 +1,19 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/bugfix/include/quick_mode_3_init.inc b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_init.inc new file mode 100644 index 00000000000..81239206dfc --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/quick_mode_3_init.inc @@ -0,0 +1,51 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +--connection master_1 +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result new file mode 100644 index 00000000000..6e5a0052370 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_0.result @@ -0,0 +1,504 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 0; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +this test is for MDEV-16520 + +drop and create databases +connection master_1; +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result new file mode 100644 index 00000000000..bca6d172a49 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_1.result @@ -0,0 +1,504 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 1; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +this test is for MDEV-16520 + +drop and create databases +connection master_1; +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result new file mode 100644 index 00000000000..61a7764dddb --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_2.result @@ -0,0 +1,504 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 2; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +this test is for MDEV-16520 + +drop and create databases +connection master_1; +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result new file mode 100644 index 00000000000..38387a45509 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/quick_mode_3.result @@ -0,0 +1,504 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +this test is for MDEV-16520 + +drop and create databases +connection master_1; +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection child2_2; +CHILD2_2_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test new file mode 100644 index 00000000000..235edc10d12 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_0.test @@ -0,0 +1,156 @@ +--source ../include/quick_mode_0_init.inc +--echo +--echo this test is for MDEV-16520 +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +--disable_query_log +echo CHILD2_2_CREATE_TABLES; +eval $CHILD2_2_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--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 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings +--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; + +--enable_warnings +--source ../include/quick_mode_0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test new file mode 100644 index 00000000000..01fa0cb5128 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_1.test @@ -0,0 +1,156 @@ +--source ../include/quick_mode_1_init.inc +--echo +--echo this test is for MDEV-16520 +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +--disable_query_log +echo CHILD2_2_CREATE_TABLES; +eval $CHILD2_2_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--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 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings +--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; + +--enable_warnings +--source ../include/quick_mode_1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test new file mode 100644 index 00000000000..3ea8138e755 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_2.test @@ -0,0 +1,156 @@ +--source ../include/quick_mode_2_init.inc +--echo +--echo this test is for MDEV-16520 +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +--disable_query_log +echo CHILD2_2_CREATE_TABLES; +eval $CHILD2_2_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--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 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings +--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; + +--enable_warnings +--source ../include/quick_mode_2_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf new file mode 100644 index 00000000000..e0ffb99c38e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_2_2.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test new file mode 100644 index 00000000000..bc926b0a296 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/quick_mode_3.test @@ -0,0 +1,157 @@ +--source ../include/quick_mode_3_init.inc +--echo +--echo this test is for MDEV-16520 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +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'; +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'; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +--disable_query_log +echo CHILD2_2_CREATE_TABLES; +eval $CHILD2_2_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--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 1 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection child2_2 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; + +--connection child2_1 +--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 +--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/ +eval $CHILD2_2_SELECT_ARGUMENT1; +eval $CHILD2_2_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings +--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; + +--enable_warnings +--source ../include/quick_mode_3_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/r/quick_mode_0.result b/storage/spider/mysql-test/spider/r/quick_mode_0.result index 1cf79124b8c..239c3ee1175 100644 --- a/storage/spider/mysql-test/spider/r/quick_mode_0.result +++ b/storage/spider/mysql-test/spider/r/quick_mode_0.result @@ -16,34 +16,27 @@ set @old_spider_quick_page_byte= @@spider_quick_page_byte; 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; 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 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) diff --git a/storage/spider/mysql-test/spider/r/quick_mode_1.result b/storage/spider/mysql-test/spider/r/quick_mode_1.result index 1d56cff3e36..d0db0729c39 100644 --- a/storage/spider/mysql-test/spider/r/quick_mode_1.result +++ b/storage/spider/mysql-test/spider/r/quick_mode_1.result @@ -16,34 +16,27 @@ set @old_spider_quick_page_byte= @@spider_quick_page_byte; 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; 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 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) diff --git a/storage/spider/mysql-test/spider/r/quick_mode_2.result b/storage/spider/mysql-test/spider/r/quick_mode_2.result index 5b0cd75af34..538057e3cda 100644 --- a/storage/spider/mysql-test/spider/r/quick_mode_2.result +++ b/storage/spider/mysql-test/spider/r/quick_mode_2.result @@ -16,34 +16,27 @@ set @old_spider_quick_page_byte= @@spider_quick_page_byte; 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; 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 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) diff --git a/storage/spider/mysql-test/spider/r/quick_mode_3.result b/storage/spider/mysql-test/spider/r/quick_mode_3.result index 4261cde2e36..9232dd152de 100644 --- a/storage/spider/mysql-test/spider/r/quick_mode_3.result +++ b/storage/spider/mysql-test/spider/r/quick_mode_3.result @@ -16,34 +16,27 @@ set @old_spider_quick_page_byte= @@spider_quick_page_byte; 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; 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 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) diff --git a/storage/spider/mysql-test/spider/t/quick_mode_0.test b/storage/spider/mysql-test/spider/t/quick_mode_0.test index ffb665c0604..6945d97a049 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_0.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_0.test @@ -3,7 +3,6 @@ --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) @@ -14,7 +13,6 @@ if ($USE_CHILD_GROUP2) 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 @@ -23,7 +21,6 @@ if ($USE_CHILD_GROUP2) 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; } @@ -42,12 +39,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -61,12 +54,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -83,10 +72,6 @@ if ($USE_CHILD_GROUP2) } } --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, diff --git a/storage/spider/mysql-test/spider/t/quick_mode_1.test b/storage/spider/mysql-test/spider/t/quick_mode_1.test index 70d61d087e3..d382d5dbe95 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_1.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_1.test @@ -3,7 +3,6 @@ --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) @@ -14,7 +13,6 @@ if ($USE_CHILD_GROUP2) 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 @@ -23,7 +21,6 @@ if ($USE_CHILD_GROUP2) 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; } @@ -42,12 +39,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -61,12 +54,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -83,10 +72,6 @@ if ($USE_CHILD_GROUP2) } } --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, diff --git a/storage/spider/mysql-test/spider/t/quick_mode_2.test b/storage/spider/mysql-test/spider/t/quick_mode_2.test index 71e7b0338dc..ebb889868a6 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_2.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_2.test @@ -3,7 +3,6 @@ --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) @@ -14,7 +13,6 @@ if ($USE_CHILD_GROUP2) 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 @@ -23,7 +21,6 @@ if ($USE_CHILD_GROUP2) 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; } @@ -42,12 +39,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -61,12 +54,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -83,10 +72,6 @@ if ($USE_CHILD_GROUP2) } } --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, diff --git a/storage/spider/mysql-test/spider/t/quick_mode_3.test b/storage/spider/mysql-test/spider/t/quick_mode_3.test index 000edd4fdff..5992284f301 100644 --- a/storage/spider/mysql-test/spider/t/quick_mode_3.test +++ b/storage/spider/mysql-test/spider/t/quick_mode_3.test @@ -3,7 +3,6 @@ --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) @@ -14,7 +13,6 @@ if ($USE_CHILD_GROUP2) 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 @@ -23,7 +21,6 @@ if ($USE_CHILD_GROUP2) 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; } @@ -42,12 +39,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -61,12 +54,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -83,10 +72,6 @@ if ($USE_CHILD_GROUP2) } } --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, -- cgit v1.2.1 From ea347fcb28167efc99db5c3f24c1baa2b57d6e86 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Tue, 25 Dec 2018 00:22:45 +0900 Subject: remove unnecessary drop database/table from slave_trx_isolation.test add simplified slave_trx_isolation.test --- .../bugfix/include/slave_trx_isolation_deinit.inc | 15 ++++ .../bugfix/include/slave_trx_isolation_init.inc | 35 ++++++++ .../spider/bugfix/r/slave_trx_isolation.result | 99 ++++++++++++++++++++++ .../spider/bugfix/t/slave_trx_isolation.cnf | 4 + .../spider/bugfix/t/slave_trx_isolation.test | 95 +++++++++++++++++++++ .../mysql-test/spider/r/slave_trx_isolation.result | 9 +- .../mysql-test/spider/t/slave_trx_isolation.test | 18 ---- 7 files changed, 250 insertions(+), 25 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_deinit.inc new file mode 100644 index 00000000000..7c20b2bc99e --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_deinit.inc @@ -0,0 +1,15 @@ +--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 +--connection slave1_1 +set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation; +--disable_warnings +--disable_query_log +--disable_result_log +--source ../include/deinit_spider.inc +--source ../t/slave_test_deinit.inc +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_init.inc b/storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_init.inc new file mode 100644 index 00000000000..3a058a55303 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/slave_trx_isolation_init.inc @@ -0,0 +1,35 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--source ../t/slave_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", 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; +--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; +--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 '%set %'; +--connection slave1_1 +--disable_warnings +--disable_query_log +--disable_result_log +--source ../include/init_spider.inc +--enable_result_log +--enable_query_log +--enable_warnings +set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation; +set global spider_slave_trx_isolation= 1; diff --git a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result new file mode 100644 index 00000000000..06581a604a2 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result @@ -0,0 +1,99 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +for slave1_1 +connection slave1_1; +set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation; +set global spider_slave_trx_isolation= 1; + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection slave1_1; +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +connection slave1_1; +connection master_1; +SET SESSION sql_log_bin= 0; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +SET SESSION sql_log_bin= 1; +connection slave1_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +connection master_1; +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +connection slave1_1; +connection master_1; +SET SESSION sql_log_bin= 0; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %'; +argument +set session time_zone = '+00:00' +SET NAMES utf8 +set session transaction isolation level read committed;set session autocommit = 1;start transaction +SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +connection slave1_1; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection slave1_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 slave1_1; +set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf new file mode 100644 index 00000000000..45019d6c537 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.cnf @@ -0,0 +1,4 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf +!include ../my_4_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test new file mode 100644 index 00000000000..652fbb1c11c --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/slave_trx_isolation.test @@ -0,0 +1,95 @@ +--source ../include/slave_trx_isolation_init.inc +--echo +--echo drop and create databases +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; + +--connection slave1_1 +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +save_master_pos; + +--connection slave1_1 +sync_with_master; + +--connection master_1 +SET SESSION sql_log_bin= 0; +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +SET SESSION sql_log_bin= 1; + +--connection slave1_1 +--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; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log + +--connection master_1 +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +save_master_pos; + +--connection slave1_1 +sync_with_master; + +--connection master_1 +SET SESSION sql_log_bin= 0; + +--connection child2_1 +eval $CHILD2_1_SELECT_ARGUMENT1; +eval $CHILD2_1_SELECT_TABLES; + +--connection slave1_1 +SELECT pkey FROM tbl_a ORDER BY pkey; + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--connection slave1_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; + +--enable_warnings +--source ../include/slave_trx_isolation_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result index 167739beaad..7d9ba40cab3 100644 --- a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result +++ b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result @@ -14,37 +14,31 @@ set global spider_slave_trx_isolation= 1; drop and create databases connection master_1; -DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; connection slave1_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; create table and insert connection child2_1; -CHILD2_1_DROP_TABLES CHILD2_1_CREATE_TABLES TRUNCATE TABLE mysql.general_log; connection master_1; connection slave1_1; connection master_1; -DROP TABLE IF EXISTS tbl_a; +SET SESSION sql_log_bin= 0; CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) ) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1 -connection master_1; SET SESSION sql_log_bin= 1; connection slave1_1; -DROP TABLE IF EXISTS tbl_a; CREATE TABLE tbl_a ( pkey int NOT NULL, PRIMARY KEY (pkey) @@ -53,6 +47,7 @@ connection master_1; INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); connection slave1_1; connection master_1; +SET SESSION sql_log_bin= 0; connection child2_1; SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %'; argument diff --git a/storage/spider/mysql-test/spider/t/slave_trx_isolation.test b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test index d1dea8546b9..507e5340779 100644 --- a/storage/spider/mysql-test/spider/t/slave_trx_isolation.test +++ b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test @@ -3,13 +3,11 @@ --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_REPLICATION) { --connection slave1_1 - DROP DATABASE IF EXISTS auto_test_local; CREATE DATABASE auto_test_local; USE auto_test_local; } @@ -21,7 +19,6 @@ if ($USE_CHILD_GROUP2) 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; } @@ -40,12 +37,8 @@ if ($USE_CHILD_GROUP2) 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) { @@ -68,13 +61,8 @@ if ($USE_REPLICATION) --connection slave1_1 sync_with_master; --connection master_1 - --disable_query_log SET SESSION sql_log_bin= 0; - --enable_query_log } ---disable_warnings -DROP TABLE IF EXISTS tbl_a; ---enable_warnings --disable_query_log echo CREATE TABLE tbl_a ( pkey int NOT NULL, @@ -85,14 +73,10 @@ eval CREATE TABLE tbl_a ( PRIMARY KEY (pkey) ) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; --enable_query_log ---connection master_1 if ($USE_REPLICATION) { SET SESSION sql_log_bin= 1; --connection slave1_1 - --disable_warnings - DROP TABLE IF EXISTS tbl_a; - --enable_warnings --disable_query_log echo CREATE TABLE tbl_a ( pkey int NOT NULL, @@ -112,9 +96,7 @@ if ($USE_REPLICATION) --connection slave1_1 sync_with_master; --connection master_1 - --disable_query_log SET SESSION sql_log_bin= 0; - --enable_query_log } if ($USE_CHILD_GROUP2) { -- cgit v1.2.1 From 470c1b8d564bdc3574376d2c50a0dac783c5b3da Mon Sep 17 00:00:00 2001 From: Kentoku Date: Mon, 31 Dec 2018 23:42:49 +0900 Subject: Fix an error at using spider_direct_sql with temporary table --- .../include/direct_sql_with_tmp_table_deinit.inc | 7 +++++ .../include/direct_sql_with_tmp_table_init.inc | 9 ++++++ .../bugfix/r/direct_sql_with_tmp_table.result | 33 ++++++++++++++++++++ .../spider/bugfix/t/direct_sql_with_tmp_table.cnf | 3 ++ .../spider/bugfix/t/direct_sql_with_tmp_table.test | 35 ++++++++++++++++++++++ 5 files changed, 87 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_tmp_table.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_deinit.inc new file mode 100644 index 00000000000..ecb5622af14 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_deinit.inc @@ -0,0 +1,7 @@ +--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/bugfix/include/direct_sql_with_tmp_table_init.inc b/storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_init.inc new file mode 100644 index 00000000000..7b58bd3e726 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/direct_sql_with_tmp_table_init.inc @@ -0,0 +1,9 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--enable_result_log +--enable_query_log +--enable_warnings +let $DIRECT_SQL_COMMAND= + SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"'); diff --git a/storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_tmp_table.result b/storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_tmp_table.result new file mode 100644 index 00000000000..65beb8a43dd --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/direct_sql_with_tmp_table.result @@ -0,0 +1,33 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +drop and create databases +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +CREATE TEMPORARY TABLE tmp_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 +SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"'); +spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"') +1 +SELECT pkey FROM tmp_a; +pkey +22 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test new file mode 100644 index 00000000000..139af5c83c9 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/direct_sql_with_tmp_table.test @@ -0,0 +1,35 @@ +--source ../include/direct_sql_with_tmp_table_init.inc +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +CREATE DATABASE auto_test_local; +USE auto_test_local; +--enable_warnings + +--disable_query_log +echo CREATE TEMPORARY TABLE tmp_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE2; +eval CREATE TEMPORARY TABLE tmp_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE2; +--enable_query_log + +eval $DIRECT_SQL_COMMAND; +SELECT pkey FROM tmp_a; + +--echo +--echo deinit +--disable_warnings + +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; + +--enable_warnings +--source ../include/direct_sql_with_tmp_table_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From 4e599c74bb673e6d752bdacffbe014cbfd033b0a Mon Sep 17 00:00:00 2001 From: Kentoku Date: Wed, 30 Jan 2019 03:29:37 +0900 Subject: MDEV-18313 Supports 'wrapper mariadb' for connection information --- .../bugfix/include/wrapper_mariadb_deinit.inc | 11 +++ .../spider/bugfix/include/wrapper_mariadb_init.inc | 24 +++++++ .../spider/bugfix/r/wrapper_mariadb.result | 78 ++++++++++++++++++++++ .../mysql-test/spider/bugfix/t/wrapper_mariadb.cnf | 3 + .../spider/bugfix/t/wrapper_mariadb.test | 69 +++++++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_deinit.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_init.inc create mode 100644 storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_deinit.inc b/storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_deinit.inc new file mode 100644 index 00000000000..76b7582abfe --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_deinit.inc @@ -0,0 +1,11 @@ +--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 +--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/bugfix/include/wrapper_mariadb_init.inc b/storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_init.inc new file mode 100644 index 00000000000..df3d44c39bc --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/include/wrapper_mariadb_init.inc @@ -0,0 +1,24 @@ +--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", srv "s_2_1", wrapper "mariadb"'; +--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, + 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; +let $CHILD2_1_SELECT_ARGUMENT1= + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; diff --git a/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result b/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result new file mode 100644 index 00000000000..7c01421fa13 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/wrapper_mariadb.result @@ -0,0 +1,78 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 + +this test is for MDEV-18313 + +drop and create databases +connection master_1; +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +create table and insert +connection child2_1; +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT * FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`pkey` `pkey` from `auto_test_remote`.`tbl_a` t0 order by `pkey` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 + +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 + +end of test diff --git a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test new file mode 100644 index 00000000000..0102155b5ab --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/wrapper_mariadb.test @@ -0,0 +1,69 @@ +--source ../include/wrapper_mariadb_init.inc +--echo +--echo this test is for MDEV-18313 +--echo +--echo drop and create databases + +--connection master_1 +--disable_warnings +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'; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +--enable_warnings + +--echo +--echo create table and insert + +--connection child2_1 +--disable_query_log +echo CHILD2_1_CREATE_TABLES; +eval $CHILD2_1_CREATE_TABLES; +--enable_query_log +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +--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; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +--echo +--echo select test + +--connection child2_1 +TRUNCATE TABLE mysql.general_log; + +--connection master_1 +SELECT * FROM tbl_a ORDER BY pkey; + +--connection child2_1 +eval $CHILD2_1_SELECT_ARGUMENT1; +eval $CHILD2_1_SELECT_TABLES; + +--echo +--echo deinit +--disable_warnings + +--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; + +--enable_warnings +--source ../include/wrapper_mariadb_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From 4a28a79e48c29b4938188136178e6f2ebd6ff7fe Mon Sep 17 00:00:00 2001 From: Kentoku Date: Tue, 20 Nov 2018 00:21:36 +0900 Subject: Update Spider to version 3.3.14. Add direct left outer join/right outer join/inner join feature --- .../spider/include/direct_join_using_deinit.inc | 9 + .../spider/include/direct_join_using_init.inc | 13 ++ .../spider/include/direct_left_join_deinit.inc | 9 + .../spider/include/direct_left_join_init.inc | 13 ++ .../include/direct_left_join_nullable_deinit.inc | 9 + .../include/direct_left_join_nullable_init.inc | 13 ++ .../direct_left_right_join_nullable_deinit.inc | 9 + .../direct_left_right_join_nullable_init.inc | 13 ++ ...direct_left_right_left_join_nullable_deinit.inc | 9 + .../direct_left_right_left_join_nullable_init.inc | 13 ++ .../spider/include/direct_right_join_deinit.inc | 9 + .../spider/include/direct_right_join_init.inc | 13 ++ .../include/direct_right_join_nullable_deinit.inc | 9 + .../include/direct_right_join_nullable_init.inc | 13 ++ .../direct_right_left_join_nullable_deinit.inc | 9 + .../direct_right_left_join_nullable_init.inc | 13 ++ ...irect_right_left_right_join_nullable_deinit.inc | 9 + .../direct_right_left_right_join_nullable_init.inc | 13 ++ .../mysql-test/spider/r/direct_join_using.result | 108 +++++++++++ .../mysql-test/spider/r/direct_left_join.result | 108 +++++++++++ .../spider/r/direct_left_join_nullable.result | 113 +++++++++++ .../r/direct_left_right_join_nullable.result | 113 +++++++++++ .../r/direct_left_right_left_join_nullable.result | 112 +++++++++++ .../mysql-test/spider/r/direct_right_join.result | 108 +++++++++++ .../spider/r/direct_right_join_nullable.result | 113 +++++++++++ .../r/direct_right_left_join_nullable.result | 112 +++++++++++ .../r/direct_right_left_right_join_nullable.result | 113 +++++++++++ .../mysql-test/spider/t/direct_join_using.test | 197 +++++++++++++++++++ .../mysql-test/spider/t/direct_left_join.test | 197 +++++++++++++++++++ .../spider/t/direct_left_join_nullable.test | 212 +++++++++++++++++++++ .../spider/t/direct_left_right_join_nullable.test | 212 +++++++++++++++++++++ .../t/direct_left_right_left_join_nullable.test | 212 +++++++++++++++++++++ .../mysql-test/spider/t/direct_right_join.test | 197 +++++++++++++++++++ .../spider/t/direct_right_join_nullable.test | 212 +++++++++++++++++++++ .../spider/t/direct_right_left_join_nullable.test | 212 +++++++++++++++++++++ .../t/direct_right_left_right_join_nullable.test | 212 +++++++++++++++++++++ 36 files changed, 3061 insertions(+) create mode 100644 storage/spider/mysql-test/spider/include/direct_join_using_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_join_using_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_init.inc create mode 100644 storage/spider/mysql-test/spider/r/direct_join_using.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_join.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_join.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result create mode 100644 storage/spider/mysql-test/spider/t/direct_join_using.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_join.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_join.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test create mode 100644 storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/direct_join_using_deinit.inc b/storage/spider/mysql-test/spider/include/direct_join_using_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_join_using_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_using_init.inc b/storage/spider/mysql-test/spider/include/direct_join_using_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_join_using_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/direct_left_join_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_join_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_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_left_join_init.inc b/storage/spider/mysql-test/spider/include/direct_left_join_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_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/direct_left_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_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_left_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_join_nullable_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/direct_left_right_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_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_left_right_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_join_nullable_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/direct_left_right_left_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_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_left_right_left_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_left_right_left_join_nullable_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/direct_right_join_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_join_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_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_right_join_init.inc b/storage/spider/mysql-test/spider/include/direct_right_join_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_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/direct_right_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_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_right_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_join_nullable_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/direct_right_left_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_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_right_left_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_join_nullable_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/direct_right_left_right_join_nullable_deinit.inc b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_deinit.inc new file mode 100644 index 00000000000..53bc29a0016 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_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_right_left_right_join_nullable_init.inc b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_init.inc new file mode 100644 index 00000000000..7e4947bf078 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/direct_right_left_right_join_nullable_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/r/direct_join_using.result b/storage/spider/mysql-test/spider/r/direct_join_using.result new file mode 100644 index 00000000000..66ae1503f9f --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_join_using.result @@ -0,0 +1,108 @@ +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 join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC; +a b c +5 50 500 +4 40 400 +3 30 300 +2 20 200 +1 10 100 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE 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 +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_left_join.result b/storage/spider/mysql-test/spider/r/direct_left_join.result new file mode 100644 index 00000000000..b63f0661b2e --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_join.result @@ -0,0 +1,108 @@ +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 left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC; +a b c +5 50 500 +4 40 400 +3 30 300 +2 20 200 +1 10 100 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r` t0 left join `auto_test_remote`.`ta_r_3` t1 on (t1.`a` = t0.`a`) left join `auto_test_remote`.`ta_r_int` t2 on (t2.`a` = t0.`a`) where 1 order by t0.`b` desc +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_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result new file mode 100644 index 00000000000..e646bc9bf38 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC; +a b c a +5 NULL NULL NULL +4 NULL NULL NULL +3 c 2000-01-03 00:00:00 NULL +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t0 left join `auto_test_remote`.`ta_r_auto_inc` t1 on ((t1.`a` = t0.`a`) and (t0.`a` is not null)) left join `auto_test_remote`.`ta_r_3` t2 on (t2.`c` = t1.`c`) left join `auto_test_remote`.`ta_r` t3 on ((t3.`b` = t2.`b`) and (t2.`b` is not null)) where 1 order by t0.`a` desc +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 + +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_left_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result new file mode 100644 index 00000000000..f3c6e189444 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_right_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL NULL NULL 5 +NULL NULL NULL 4 +NULL NULL NULL 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 join `auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r` t0) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null) and (t3.`b` is not null)) where 1 order by t3.`a` desc +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 + +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_left_right_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result new file mode 100644 index 00000000000..88205fb0f65 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_left_right_left_join_nullable.result @@ -0,0 +1,112 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL d 2000-01-04 00:00:00 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_auto_inc` t2 left join (`auto_test_remote`.`ta_r_3` t1 join `auto_test_remote`.`ta_r` t0) on ((t1.`c` = t2.`c`) and (t0.`a` = t1.`a`) and (t1.`a` is not null)) left join `auto_test_remote`.`ta_r_no_idx` t3 on (t3.`b` = t2.`b`) where 1 order by t3.`a` desc +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 + +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_right_join.result b/storage/spider/mysql-test/spider/r/direct_right_join.result new file mode 100644 index 00000000000..8edfb682292 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_join.result @@ -0,0 +1,108 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection child2_1; +SET @old_log_output = @@global.log_output; +SET GLOBAL log_output = 'TABLE,FILE'; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; + +test select 1 +connection master_1; +SELECT 1; +1 +1 +connection child2_1; +SELECT 1; +1 +1 + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_DROP_TABLES6 +CHILD2_1_DROP_TABLES5 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES5 +TRUNCATE TABLE mysql.general_log; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +PRIMARY KEY(a), +KEY idx1(b) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +CREATE TABLE tbl_b ( +a INT DEFAULT 10, +b CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10' +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1 +CREATE TABLE tbl_c ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); +insert into tbl_c values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; +a b c +5 50 500 +4 40 400 +3 30 300 +2 20 200 +1 10 100 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`b` `b`,t0.`a` `a`,t2.`b` `b`,t2.`c` `c` from `auto_test_remote`.`ta_r_int` t2 left join (`auto_test_remote`.`ta_r` t0 join `auto_test_remote`.`ta_r_3` t1) on ((t0.`a` = t2.`a`) and (t1.`a` = t2.`a`)) where 1 order by t0.`b` desc +SELECT argument FROM mysql.general_log WHERE 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_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result new file mode 100644 index 00000000000..a05781cb6d6 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL NULL NULL 5 +NULL d 2000-01-04 00:00:00 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join `auto_test_remote`.`ta_r_auto_inc` t2 on ((t2.`b` = t3.`b`) and (t3.`b` is not null)) left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) where 1 order by t3.`a` desc +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 + +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_right_left_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result new file mode 100644 index 00000000000..25e0913ba06 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_left_join_nullable.result @@ -0,0 +1,112 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL d 2000-01-04 00:00:00 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_auto_inc` t2 left join `auto_test_remote`.`ta_r_3` t1 on (t1.`c` = t2.`c`) left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null)) left join `auto_test_remote`.`ta_r_no_idx` t3 on (t3.`b` = t2.`b`) where 1 order by t3.`a` desc +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 + +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_right_left_right_join_nullable.result b/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result new file mode 100644 index 00000000000..48cd9c2c75f --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_right_left_right_join_nullable.result @@ -0,0 +1,113 @@ +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_TABLES4 +CHILD2_1_DROP_TABLES3 +CHILD2_1_CREATE_TABLES +CHILD2_1_CREATE_TABLES6 +CHILD2_1_CREATE_TABLES4 +CHILD2_1_CREATE_TABLES3 +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', +KEY idx0(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 CHAR(1) DEFAULT 'c', +c DATETIME DEFAULT '1999-10-10 10:10:10', +KEY idx0(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1 +CREATE TABLE tbl_d ( +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_COMMENT2_2_1 +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +select test +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; +a b c a +NULL NULL NULL 5 +NULL NULL NULL 4 +NULL c 2000-01-03 00:00:00 3 +2 b 2000-01-02 00:00:00 2 +1 a 2000-01-01 00:00:00 1 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select t0.`a` `a`,t2.`b` `b`,t2.`c` `c`,t3.`a` `a` from `auto_test_remote`.`ta_r_no_idx` t3 left join (`auto_test_remote`.`ta_r_auto_inc` t2 join `auto_test_remote`.`ta_r_3` t1 left join `auto_test_remote`.`ta_r` t0 on ((t0.`a` = t1.`a`) and (t1.`a` is not null))) on ((t2.`b` = t3.`b`) and (t2.`c` = t1.`c`) and (t3.`b` is not null)) where 1 order by t3.`a` desc +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 + +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/t/direct_join_using.test b/storage/spider/mysql-test/spider/t/direct_join_using.test new file mode 100644 index 00000000000..819e56ff21c --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_join_using.test @@ -0,0 +1,197 @@ +--source ../include/direct_join_using_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 join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC; + +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_using_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_join.test b/storage/spider/mysql-test/spider/t/direct_left_join.test new file mode 100644 index 00000000000..e09b6a12488 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_join.test @@ -0,0 +1,197 @@ +--source ../include/direct_left_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 left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC; + +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_left_join_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test new file mode 100644 index 00000000000..dc67a01b4b2 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_left_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC; + +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_left_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test new file mode 100644 index 00000000000..9d5a990e0ba --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_right_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_left_right_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_left_right_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test new file mode 100644 index 00000000000..90e3666957d --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_left_right_left_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_left_right_left_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_left_right_left_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_join.test b/storage/spider/mysql-test/spider/t/direct_right_join.test new file mode 100644 index 00000000000..0c0496651d6 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_join.test @@ -0,0 +1,197 @@ +--source ../include/direct_right_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 right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC; + +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_right_join_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test new file mode 100644 index 00000000000..3ab4a30ea84 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_right_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_right_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test new file mode 100644 index 00000000000..fefe255890d --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_left_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_right_left_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_right_left_join_nullable_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test new file mode 100644 index 00000000000..48882d27939 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_right_left_right_join_nullable.test @@ -0,0 +1,212 @@ +--source ../include/direct_right_left_right_join_nullable_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_TABLES4; + echo CHILD2_1_DROP_TABLES3; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES6; + echo CHILD2_1_CREATE_TABLES4; + echo CHILD2_1_CREATE_TABLES3; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES6; + eval $CHILD2_1_DROP_TABLES4; + eval $CHILD2_1_DROP_TABLES3; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES6; + eval $CHILD2_1_CREATE_TABLES4; + eval $CHILD2_1_CREATE_TABLES3; + 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', + KEY idx0(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', + KEY idx0(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 CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_2_1; +eval CREATE TABLE tbl_c ( + a INT AUTO_INCREMENT, + b CHAR(1) DEFAULT 'c', + c DATETIME DEFAULT '1999-10-10 10:10:10', + KEY idx0(a), + KEY idx1(b), + KEY idx2(c) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_2_1; +echo CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +eval CREATE TABLE tbl_d ( + 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_COMMENT2_2_1; +--enable_query_log +insert into tbl_a values (1,'a','2000/01/01'),(2,'b','2000/01/02'); +insert into tbl_b values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'); +insert into tbl_c values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'); +insert into tbl_d values (1,'a','2000/01/01'),(2,'b','2000/01/02'),(3,'c','2000/01/03'),(4,'d','2000/01/04'),(5,'e','2000/01/05'); + +--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, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC; + +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_right_left_right_join_nullable_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From 41e60e7fe8a33a4f44382998ed50401dabea7a63 Mon Sep 17 00:00:00 2001 From: Kentoku Date: Fri, 30 Nov 2018 03:26:42 +0900 Subject: MDEV-16520 Out-Of-Memory running big aggregate query on Spider Engine Change default value of the followings quick_mode 0 -> 3 quick_page_size 100 -> 1024 Add the following parameter for limiting result page size by byte - quick_page_byte(qpb) Number of bytes in a page when acquisition one by one. When quick_mode is 1 or 2, Spider stores at least 1 record even if quick_page_byte is smaller than 1 record. When quick_mode is 3, quick_page_byte is used for judging using temporary table. That is given to priority when server parameter spider_quick_page_byte is set. The default value is 10485760 Fix "out of sync" issue at using quick_mode = 1 or 2 --- .../spider/include/quick_mode_0_deinit.inc | 21 + .../spider/include/quick_mode_0_init.inc | 55 +++ .../spider/include/quick_mode_1_deinit.inc | 21 + .../spider/include/quick_mode_1_init.inc | 55 +++ .../spider/include/quick_mode_2_deinit.inc | 21 + .../spider/include/quick_mode_2_init.inc | 55 +++ .../spider/include/quick_mode_3_deinit.inc | 21 + .../spider/include/quick_mode_3_init.inc | 55 +++ .../spider/mysql-test/spider/r/quick_mode_0.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/r/quick_mode_1.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/r/quick_mode_2.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/r/quick_mode_3.result | 515 +++++++++++++++++++++ .../spider/mysql-test/spider/t/quick_mode_0.test | 309 +++++++++++++ .../spider/mysql-test/spider/t/quick_mode_1.test | 309 +++++++++++++ .../spider/mysql-test/spider/t/quick_mode_2.test | 309 +++++++++++++ .../spider/mysql-test/spider/t/quick_mode_3.test | 309 +++++++++++++ 16 files changed, 3600 insertions(+) create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_0_init.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_1_init.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_2_init.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/quick_mode_3_init.inc create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_0.result create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_1.result create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_2.result create mode 100644 storage/spider/mysql-test/spider/r/quick_mode_3.result create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_0.test create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_1.test create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_2.test create mode 100644 storage/spider/mysql-test/spider/t/quick_mode_3.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_0_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_0_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_0_init.inc new file mode 100644 index 00000000000..92afb3bf10b --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_0_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 0; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_1_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_1_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_1_init.inc new file mode 100644 index 00000000000..cc5a847fdc0 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_1_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 1; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_2_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_2_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_2_init.inc new file mode 100644 index 00000000000..3a16bb1dc63 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_2_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 2; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc b/storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc new file mode 100644 index 00000000000..72d09f54316 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_3_deinit.inc @@ -0,0 +1,21 @@ +--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 $OUTPUT_CHILD_GROUP2= $OUTPUT_CHILD_GROUP2_BACKUP +--let $USE_GENERAL_LOG= $USE_GENERAL_LOG_BACKUP +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +--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/quick_mode_3_init.inc b/storage/spider/mysql-test/spider/include/quick_mode_3_init.inc new file mode 100644 index 00000000000..df7d713c4c7 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/quick_mode_3_init.inc @@ -0,0 +1,55 @@ +--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", srv "s_2_1"'; +--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2 +let $MASTER_1_COMMENT_2_2= + COMMENT='table "tbl_b", srv "s_2_2"'; +--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, + 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; +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_b; +--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES +let $CHILD2_2_CREATE_TABLES= + 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_b ORDER BY pkey; +let $CHILD2_2_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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; +let $MASTER_1_SET_QUICK_PAGE_BYTE_6= + set session spider_quick_page_byte= 6; +let $MASTER_1_SET_QUICK_PAGE_BYTE_0= + set session spider_quick_page_byte= 0; diff --git a/storage/spider/mysql-test/spider/r/quick_mode_0.result b/storage/spider/mysql-test/spider/r/quick_mode_0.result new file mode 100644 index 00000000000..1cf79124b8c --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_0.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 0; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/quick_mode_1.result b/storage/spider/mysql-test/spider/r/quick_mode_1.result new file mode 100644 index 00000000000..1d56cff3e36 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_1.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 1; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/quick_mode_2.result b/storage/spider/mysql-test/spider/r/quick_mode_2.result new file mode 100644 index 00000000000..5b0cd75af34 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_2.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 2; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/quick_mode_3.result b/storage/spider/mysql-test/spider/r/quick_mode_3.result new file mode 100644 index 00000000000..4261cde2e36 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/quick_mode_3.result @@ -0,0 +1,515 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; +set @old_spider_quick_page_size= @@spider_quick_page_size; +set session spider_quick_page_size= 3; +set @old_spider_quick_page_byte= @@spider_quick_page_byte; + +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; + +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 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 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 6; + +select test 2 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection master_1; +set session spider_quick_page_byte= 0; + +select test 3 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection child2_2; +TRUNCATE TABLE mysql.general_log; +connection master_1; +SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +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 argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +connection child2_2; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28 +select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29 +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_b ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +set session spider_quick_page_size= @old_spider_quick_page_size; +set session spider_quick_page_byte= @old_spider_quick_page_byte; +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/t/quick_mode_0.test b/storage/spider/mysql-test/spider/t/quick_mode_0.test new file mode 100644 index 00000000000..ffb665c0604 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_0.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_0_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_0_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/quick_mode_1.test b/storage/spider/mysql-test/spider/t/quick_mode_1.test new file mode 100644 index 00000000000..70d61d087e3 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_1.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_1_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_1_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/quick_mode_2.test b/storage/spider/mysql-test/spider/t/quick_mode_2.test new file mode 100644 index 00000000000..71e7b0338dc --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_2.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_2_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_2_deinit.inc +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/quick_mode_3.test b/storage/spider/mysql-test/spider/t/quick_mode_3.test new file mode 100644 index 00000000000..000edd4fdff --- /dev/null +++ b/storage/spider/mysql-test/spider/t/quick_mode_3.test @@ -0,0 +1,309 @@ +--source ../include/quick_mode_3_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; + --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; +} +--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; + } + 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 1 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_6; + +--echo +--echo select test 2 +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; + } + --connection child2_2 + 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; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +eval $MASTER_1_SET_QUICK_PAGE_BYTE_0; + +--echo +--echo select test 3 +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; + } + --connection child2_2 + 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; + 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; + } +} +--enable_warnings +--source ../include/quick_mode_3_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From 540e82d1b4376a2588c24ca1efa1e7cc52ae755d Mon Sep 17 00:00:00 2001 From: Kentoku Date: Thu, 13 Dec 2018 03:13:31 +0900 Subject: MDEV-16787 optimistic parallel replication fails on spider Add a system variable spider_slave_trx_isolation. - spider_slave_trx_isolation The transaction isolation level when Spider table is used by slave SQL thread. -1 : OFF 0 : READ UNCOMMITTED 1 : READ COMMITTED 2 : REPEATABLE READ 3 : SERIALIZABLE The default value is -1 Miscellaneous Spider typos --- .../spider/include/slave_trx_isolation_deinit.inc | 17 +++ .../spider/include/slave_trx_isolation_init.inc | 39 +++++ .../mysql-test/spider/r/slave_trx_isolation.result | 110 ++++++++++++++ .../mysql-test/spider/t/slave_trx_isolation.test | 166 +++++++++++++++++++++ 4 files changed, 332 insertions(+) create mode 100644 storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc create mode 100644 storage/spider/mysql-test/spider/r/slave_trx_isolation.result create mode 100644 storage/spider/mysql-test/spider/t/slave_trx_isolation.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc b/storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc new file mode 100644 index 00000000000..e5f585e5cca --- /dev/null +++ b/storage/spider/mysql-test/spider/include/slave_trx_isolation_deinit.inc @@ -0,0 +1,17 @@ +--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 +--connection slave1_1 +set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation; +--disable_warnings +--disable_query_log +--disable_result_log +--source ../include/deinit_spider.inc +--source ../t/slave_test_deinit.inc +--source ../t/test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings diff --git a/storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc b/storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc new file mode 100644 index 00000000000..94ccf1d3295 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/slave_trx_isolation_init.inc @@ -0,0 +1,39 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source ../t/test_init.inc +--source ../t/slave_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", 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; +--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; +--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 '%set %'; +--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 slave1_1 +--disable_warnings +--disable_query_log +--disable_result_log +--source ../include/init_spider.inc +--enable_result_log +--enable_query_log +--enable_warnings +set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation; +set global spider_slave_trx_isolation= 1; diff --git a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result new file mode 100644 index 00000000000..167739beaad --- /dev/null +++ b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result @@ -0,0 +1,110 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 +connection slave1_1; +set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation; +set global spider_slave_trx_isolation= 1; + +drop and create databases +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +connection slave1_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; + +create table and insert +connection child2_1; +CHILD2_1_DROP_TABLES +CHILD2_1_CREATE_TABLES +TRUNCATE TABLE mysql.general_log; +connection master_1; +connection slave1_1; +connection master_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +connection master_1; +SET SESSION sql_log_bin= 1; +connection slave1_1; +DROP TABLE IF EXISTS tbl_a; +CREATE TABLE tbl_a ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +connection master_1; +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +connection slave1_1; +connection master_1; +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %'; +argument +set session time_zone = '+00:00' +SET NAMES utf8 +set session transaction isolation level read committed;set session autocommit = 1;start transaction +SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +connection slave1_1; +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 + +deinit +connection master_1; +DROP DATABASE IF EXISTS auto_test_local; +connection slave1_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 slave1_1; +set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation; +for slave1_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/t/slave_trx_isolation.test b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test new file mode 100644 index 00000000000..d1dea8546b9 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/slave_trx_isolation.test @@ -0,0 +1,166 @@ +--source ../include/slave_trx_isolation_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_REPLICATION) +{ + --connection slave1_1 + 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 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; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +--connection master_1 +if ($USE_REPLICATION) +{ + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log +} +--disable_warnings +DROP TABLE IF EXISTS tbl_a; +--enable_warnings +--disable_query_log +echo CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--enable_query_log +--connection master_1 +if ($USE_REPLICATION) +{ + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS tbl_a; + --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; + eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; + --enable_query_log + --connection master_1 +} +INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +if ($USE_REPLICATION) +{ + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log +} +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 + } +} +if ($USE_REPLICATION) +{ + --connection slave1_1 + SELECT pkey FROM tbl_a ORDER BY pkey; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_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/slave_trx_isolation_deinit.inc +--echo +--echo end of test -- cgit v1.2.1 From 5b996782be6b752ce50a0ecaa222b0688aa9e75d Mon Sep 17 00:00:00 2001 From: Kentoku Date: Mon, 24 Dec 2018 15:38:56 +0900 Subject: MDEV-16279 Spider crashes on CHECKSUM TABLE with spider_quick_mode=3 add tests --- .../checksum_table_with_quick_mode_3_deinit.inc | 15 +++ .../checksum_table_with_quick_mode_3_init.inc | 31 +++++ .../r/checksum_table_with_quick_mode_3.result | 104 ++++++++++++++++ .../spider/t/checksum_table_with_quick_mode_3.test | 134 +++++++++++++++++++++ 4 files changed, 284 insertions(+) create mode 100644 storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc create mode 100644 storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc create mode 100644 storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result create mode 100644 storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test (limited to 'storage/spider/mysql-test') diff --git a/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc new file mode 100644 index 00000000000..3316472c773 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_deinit.inc @@ -0,0 +1,15 @@ +--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 +--connection master_1 +set session spider_quick_mode= @old_spider_quick_mode; +--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/checksum_table_with_quick_mode_3_init.inc b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc new file mode 100644 index 00000000000..1cc6ca4ee32 --- /dev/null +++ b/storage/spider/mysql-test/spider/include/checksum_table_with_quick_mode_3_init.inc @@ -0,0 +1,31 @@ +--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", 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; +--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; +--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 $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_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 3; diff --git a/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result new file mode 100644 index 00000000000..fd748dc8590 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/checksum_table_with_quick_mode_3.result @@ -0,0 +1,104 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +connection master_1; +set @old_spider_quick_mode= @@spider_quick_mode; +set session spider_quick_mode= 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; + +create table and insert +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 ( +pkey int NOT NULL, +PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1 +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); + +select test 1 +connection child2_1; +TRUNCATE TABLE mysql.general_log; +connection master_1; +CHECKSUM TABLE tbl_a EXTENDED; +Table Checksum +auto_test_local.tbl_a 1061386331 +connection child2_1; +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; +argument +select `pkey` from `auto_test_remote`.`tbl_a` +SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %' +SELECT pkey FROM tbl_a ORDER BY pkey; +pkey +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 + +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 master_1; +set session spider_quick_mode= @old_spider_quick_mode; +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/t/checksum_table_with_quick_mode_3.test b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test new file mode 100644 index 00000000000..bf0d8bfa0a0 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/checksum_table_with_quick_mode_3.test @@ -0,0 +1,134 @@ +--source ../include/checksum_table_with_quick_mode_3_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 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; + } + 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 ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1; +eval CREATE TABLE tbl_a ( + pkey int NOT NULL, + PRIMARY KEY (pkey) +) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1; +--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); + +--echo +--echo select test 1 +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 +CHECKSUM TABLE tbl_a EXTENDED; +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/checksum_table_with_quick_mode_3_deinit.inc +--echo +--echo end of test -- cgit v1.2.1