diff options
33 files changed, 3816 insertions, 30 deletions
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index 8471af40289..e60355958bd 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -7378,6 +7378,8 @@ int ha_spider::rnd_init( #endif if (quick_targets[roop_count]) { + spider_db_free_one_quick_result( + (SPIDER_RESULT *) result_list.current); DBUG_ASSERT(quick_targets[roop_count] == conns[roop_count]->quick_target); DBUG_PRINT("info", ("spider conn[%p]->quick_target=NULL", diff --git a/storage/spider/hs_client/hstcpcli.cpp b/storage/spider/hs_client/hstcpcli.cpp index 2cb37c7be9d..4c93b5a3a49 100644 --- a/storage/spider/hs_client/hstcpcli.cpp +++ b/storage/spider/hs_client/hstcpcli.cpp @@ -67,6 +67,8 @@ struct hstcpcli : public hstcpcli_i, private noncopyable { virtual int get_result(hstresult& result); virtual const string_ref *get_next_row(); virtual const string_ref *get_next_row_from_result(hstresult& result); + virtual size_t get_row_size(); + virtual size_t get_row_size_from_result(hstresult& result); virtual void response_buf_remove(); virtual int get_error_code(); virtual String& get_error(); @@ -93,6 +95,7 @@ struct hstcpcli : public hstcpcli_i, private noncopyable { string_buffer writebuf; size_t response_end_offset; /* incl newline */ size_t cur_row_offset; + size_t cur_row_size; size_t num_flds; size_t num_req_bufd; /* buffered but not yet sent */ size_t num_req_sent; /* sent but not yet received */ @@ -104,8 +107,9 @@ struct hstcpcli : public hstcpcli_i, private noncopyable { }; hstcpcli::hstcpcli(const socket_args& args) - : sargs(args), response_end_offset(0), cur_row_offset(0), num_flds(0), - num_req_bufd(0), num_req_sent(0), num_req_rcvd(0), error_code(0), errno_buf(0) + : sargs(args), response_end_offset(0), cur_row_offset(0), cur_row_size(0), + num_flds(0), num_req_bufd(0), num_req_sent(0), num_req_rcvd(0), + error_code(0), errno_buf(0) { String err; SPD_INIT_DYNAMIC_ARRAY2(&flds, sizeof(string_ref), NULL, 16, 16, MYF(MY_WME)); @@ -503,6 +507,7 @@ hstcpcli::response_recv(size_t& num_flds_r) } return set_error(resp_code, e); } + cur_row_size = 0; cur_row_offset = start - readbuf.begin(); DBG(fprintf(stderr, "[%s] ro=%zu eol=%zu\n", String(readbuf.begin(), readbuf.begin() + response_end_offset) @@ -529,6 +534,7 @@ hstcpcli::get_result(hstresult& result) result.readbuf.space_wrote(response_end_offset); result.response_end_offset = response_end_offset; result.num_flds = num_flds; + result.cur_row_size = cur_row_size; result.cur_row_offset = cur_row_offset; if (result.flds.max_element < num_flds) { @@ -566,6 +572,7 @@ hstcpcli::get_next_row() ((string_ref *) flds.buffer)[i] = string_ref(fld_begin, wp); } } + cur_row_size = start - (readbuf.begin() + cur_row_offset); cur_row_offset = start - readbuf.begin(); return (string_ref *) flds.buffer; } @@ -597,10 +604,24 @@ hstcpcli::get_next_row_from_result(hstresult& result) ((string_ref *) result.flds.buffer)[i] = string_ref(fld_begin, wp); } } + result.cur_row_size = + start - (result.readbuf.begin() + result.cur_row_offset); result.cur_row_offset = start - result.readbuf.begin(); return (string_ref *) result.flds.buffer; } +size_t +hstcpcli::get_row_size() +{ + return cur_row_size; +} + +size_t +hstcpcli::get_row_size_from_result(hstresult& result) +{ + return result.cur_row_size; +} + void hstcpcli::response_buf_remove() { diff --git a/storage/spider/hs_client/hstcpcli.hpp b/storage/spider/hs_client/hstcpcli.hpp index d153b19cf9b..6894716e469 100644 --- a/storage/spider/hs_client/hstcpcli.hpp +++ b/storage/spider/hs_client/hstcpcli.hpp @@ -46,6 +46,7 @@ struct hstresult { size_t response_end_offset; size_t num_flds; size_t cur_row_offset; + size_t cur_row_size; DYNAMIC_ARRAY flds; }; @@ -71,6 +72,8 @@ struct hstcpcli_i { virtual int get_result(hstresult& result) = 0; virtual const string_ref *get_next_row() = 0; virtual const string_ref *get_next_row_from_result(hstresult& result) = 0; + virtual size_t get_row_size() = 0; + virtual size_t get_row_size_from_result(hstresult& result) = 0; virtual void response_buf_remove() = 0; virtual int get_error_code() = 0; virtual String& get_error() = 0; 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 diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc index d48ec1f2285..ba59acd64bc 100644 --- a/storage/spider/spd_conn.cc +++ b/storage/spider/spd_conn.cc @@ -2087,6 +2087,7 @@ void spider_bg_all_conn_break( #endif if (spider->quick_targets[roop_count]) { + spider_db_free_one_quick_result((SPIDER_RESULT *) result_list->current); DBUG_ASSERT(spider->quick_targets[roop_count] == conn->quick_target); DBUG_PRINT("info", ("spider conn[%p]->quick_target=NULL", conn)); conn->quick_target = NULL; diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index 1e117b68728..c2cd4beccdb 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -3473,6 +3473,22 @@ void spider_db_free_one_result( DBUG_VOID_RETURN; } +void spider_db_free_one_quick_result( + SPIDER_RESULT *result +) { + DBUG_ENTER("spider_db_free_one_quick_result"); + if (result && result->result) + { + result->result->free_result(); + if (!result->result_tmp_tbl) + { + delete result->result; + result->result = NULL; + } + } + DBUG_VOID_RETURN; +} + int spider_db_free_result( ha_spider *spider, bool final @@ -3999,11 +4015,22 @@ int spider_db_store_result( SPIDER_DB_ROW *tmp_row; uint field_count = current->result->num_fields(); SPIDER_POSITION *position; - longlong page_size = - !result_list->quick_page_size || - result_list->limit_num < result_list->quick_page_size ? - result_list->limit_num : result_list->quick_page_size; + longlong page_size; int roop_count = 0; + if (!result_list->quick_page_size) + { + if (result_list->quick_mode == 3) + { + page_size = 0; + } else { + result_list->quick_page_size = result_list->limit_num; + page_size = result_list->limit_num; + } + } else { + page_size = + result_list->limit_num < result_list->quick_page_size ? + result_list->limit_num : result_list->quick_page_size; + } current->field_count = field_count; if (!(position = (SPIDER_POSITION *) spider_bulk_malloc(spider_current_trx, 7, MYF(MY_WME | MY_ZEROFILL), @@ -4015,22 +4042,56 @@ int spider_db_store_result( current->pos_page_size = (int) page_size; current->first_position = position; current->tmp_tbl_row = tmp_row; - do { - if (!(position->row = row->clone())) + if (result_list->quick_mode == 3) + { + while (page_size > roop_count && row) { - DBUG_RETURN(HA_ERR_OUT_OF_MEM); + if (result_list->quick_page_byte < row->get_byte_size()) + { + current->pos_page_size = roop_count; + page_size = roop_count; + result_list->quick_page_size = roop_count; + result_list->quick_page_byte = 0; + break; + } else { + result_list->quick_page_byte -= row->get_byte_size(); + } + if (!(position->row = row->clone())) + { + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + position++; + roop_count++; + row = current->result->fetch_row(); } - position++; - roop_count++; - } while ( - page_size > roop_count && - (row = current->result->fetch_row()) - ); + } else { + do { + if (!(position->row = row->clone())) + { + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + position++; + roop_count++; + if (result_list->quick_page_byte < row->get_byte_size()) + { + current->pos_page_size = roop_count; + page_size = roop_count; + result_list->quick_page_size = roop_count; + result_list->quick_page_byte = 0; + break; + } else { + result_list->quick_page_byte -= row->get_byte_size(); + } + } while ( + page_size > roop_count && + (row = current->result->fetch_row()) + ); + } if ( result_list->quick_mode == 3 && page_size == roop_count && result_list->limit_num > roop_count && - (row = current->result->fetch_row()) + row ) { THD *thd = current_thd; char buf[MAX_FIELD_WIDTH]; @@ -4076,7 +4137,11 @@ int spider_db_store_result( result_list->record_num += roop_count; if ( result_list->internal_limit <= result_list->record_num || - page_size > roop_count + page_size > roop_count || + ( + result_list->quick_mode == 3 && + result_list->limit_num > roop_count + ) ) { DBUG_PRINT("info",("spider set finish_flg point 4")); DBUG_PRINT("info",("spider current->finish_flg = TRUE")); diff --git a/storage/spider/spd_db_conn.h b/storage/spider/spd_db_conn.h index 6ff35b794cd..bf09d672685 100644 --- a/storage/spider/spd_db_conn.h +++ b/storage/spider/spd_db_conn.h @@ -579,6 +579,10 @@ void spider_db_free_one_result( SPIDER_RESULT *result ); +void spider_db_free_one_quick_result( + SPIDER_RESULT *result +); + int spider_db_free_result( ha_spider *spider, bool final diff --git a/storage/spider/spd_db_handlersocket.cc b/storage/spider/spd_db_handlersocket.cc index 412450b96f8..4aebc7811b4 100644 --- a/storage/spider/spd_db_handlersocket.cc +++ b/storage/spider/spd_db_handlersocket.cc @@ -359,7 +359,7 @@ spider_string *spider_db_hs_str_buffer::add( spider_db_handlersocket_row::spider_db_handlersocket_row() : spider_db_row(spider_dbton_handlersocket.dbton_id), - hs_row(NULL), field_count(0), cloned(FALSE) + hs_row(NULL), field_count(0), row_size(0), cloned(FALSE) { DBUG_ENTER("spider_db_handlersocket_row::spider_db_handlersocket_row"); DBUG_PRINT("info",("spider this=%p", this)); @@ -497,18 +497,13 @@ SPIDER_DB_ROW *spider_db_handlersocket_row::clone() { spider_db_handlersocket_row *clone_row; char *tmp_char; - uint row_size, i; + uint i; DBUG_ENTER("spider_db_handlersocket_row::clone"); DBUG_PRINT("info",("spider this=%p", this)); if (!(clone_row = new spider_db_handlersocket_row())) { DBUG_RETURN(NULL); } - row_size = 0; - for (i = 0; i < field_count; i++) - { - row_size += hs_row_first[i].size(); - } if (!spider_bulk_malloc(spider_current_trx, 169, MYF(MY_WME), &clone_row->hs_row, sizeof(SPIDER_HS_STRING_REF) * field_count, &tmp_char, row_size, @@ -525,6 +520,7 @@ SPIDER_DB_ROW *spider_db_handlersocket_row::clone() } clone_row->hs_row_first = clone_row->hs_row; clone_row->cloned = TRUE;; + clone_row->row_size = row_size;; DBUG_RETURN(NULL); } @@ -560,6 +556,13 @@ int spider_db_handlersocket_row::store_to_tmp_table( DBUG_RETURN(tmp_table->file->ha_write_row(tmp_table->record[0])); } +uint spider_db_handlersocket_row::get_byte_size() +{ + DBUG_ENTER("spider_db_handlersocket_row::get_byte_size"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(row_size); +} + spider_db_handlersocket_result_buffer::spider_db_handlersocket_result_buffer( ) : spider_db_result_buffer() @@ -676,6 +679,7 @@ SPIDER_DB_ROW *spider_db_handlersocket_result::fetch_row() } row.field_count = field_count; row.hs_row_first = row.hs_row; + row.row_size = (*hs_conn_p)->get_row_size(); DBUG_RETURN((SPIDER_DB_ROW *) &row); } @@ -694,6 +698,7 @@ SPIDER_DB_ROW *spider_db_handlersocket_result::fetch_row_from_result_buffer( } row.field_count = field_count; row.hs_row_first = row.hs_row; + row.row_size = (*hs_conn_p)->get_row_size_from_result(hs_res_buf->hs_result); DBUG_RETURN((SPIDER_DB_ROW *) &row); } @@ -729,6 +734,7 @@ SPIDER_DB_ROW *spider_db_handlersocket_result::fetch_row_from_tmp_table( } tmp_hs_row++; } + row.row_size = row_ptr - tmp_str2.ptr(); DBUG_RETURN((SPIDER_DB_ROW *) &row); } diff --git a/storage/spider/spd_db_handlersocket.h b/storage/spider/spd_db_handlersocket.h index 3767f0f3fac..075f8720abf 100644 --- a/storage/spider/spd_db_handlersocket.h +++ b/storage/spider/spd_db_handlersocket.h @@ -145,6 +145,7 @@ public: SPIDER_HS_STRING_REF *hs_row; SPIDER_HS_STRING_REF *hs_row_first; uint field_count; + uint row_size; bool cloned; spider_db_handlersocket_row(); ~spider_db_handlersocket_row(); @@ -173,6 +174,7 @@ public: TABLE *tmp_table, spider_string *str ); + uint get_byte_size(); }; class spider_db_handlersocket_result_buffer: public spider_db_result_buffer diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h index 7f1148655e3..cc4d2bcd3a1 100644 --- a/storage/spider/spd_db_include.h +++ b/storage/spider/spd_db_include.h @@ -941,6 +941,7 @@ public: TABLE *tmp_table, spider_string *str ) = 0; + virtual uint get_byte_size() = 0; }; class spider_db_result_buffer @@ -1947,6 +1948,7 @@ typedef struct st_spider_result_list int max_order; int quick_mode; longlong quick_page_size; + longlong quick_page_byte; int low_mem_read; int bulk_update_mode; int bulk_update_size; diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 8c17bc8970d..39f448e44c0 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -415,11 +415,17 @@ SPIDER_DB_ROW *spider_db_mysql_row::clone() { DBUG_RETURN(NULL); } - row_size = field_count; - for (i = 0; i < field_count; i++) + if (!record_size) { - row_size += *tmp_lengths; - tmp_lengths++; + row_size = field_count; + for (i = 0; i < field_count; i++) + { + row_size += *tmp_lengths; + tmp_lengths++; + } + record_size = row_size - field_count; + } else { + row_size = record_size + field_count; } if (!spider_bulk_malloc(spider_current_trx, 29, MYF(MY_WME), &clone_row->row, sizeof(char*) * field_count, @@ -451,6 +457,7 @@ SPIDER_DB_ROW *spider_db_mysql_row::clone() tmp_row++; } clone_row->field_count = field_count; + clone_row->record_size = record_size; clone_row->row_first = clone_row->row; clone_row->lengths_first = clone_row->lengths; clone_row->cloned = TRUE; @@ -493,6 +500,23 @@ int spider_db_mysql_row::store_to_tmp_table( DBUG_RETURN(tmp_table->file->ha_write_row(tmp_table->record[0])); } +uint spider_db_mysql_row::get_byte_size() +{ + ulong *tmp_lengths = lengths_first; + uint i; + DBUG_ENTER("spider_db_mysql_row::get_byte_size"); + DBUG_PRINT("info",("spider this=%p", this)); + if (!record_size) + { + for (i = 0; i < field_count; i++) + { + record_size += *tmp_lengths; + tmp_lengths++; + } + } + DBUG_RETURN(record_size); +} + spider_db_mysql_result::spider_db_mysql_result(SPIDER_DB_CONN *in_db_conn) : spider_db_result(in_db_conn, spider_dbton_mysql.dbton_id), db_result(NULL) @@ -559,6 +583,7 @@ SPIDER_DB_ROW *spider_db_mysql_result::fetch_row() row.field_count = mysql_num_fields(db_result); row.row_first = row.row; row.lengths_first = row.lengths; + row.record_size = 0; DBUG_RETURN((SPIDER_DB_ROW *) &row); } @@ -582,6 +607,7 @@ SPIDER_DB_ROW *spider_db_mysql_result::fetch_row_from_result_buffer( row.field_count = mysql_num_fields(db_result); row.row_first = row.row; row.lengths_first = row.lengths; + row.record_size = 0; DBUG_RETURN((SPIDER_DB_ROW *) &row); } @@ -614,6 +640,7 @@ SPIDER_DB_ROW *spider_db_mysql_result::fetch_row_from_tmp_table( row.field_count = field_count; row.row_first = row.row; row.lengths_first = row.lengths; + row.record_size = tmp_str2.length(); for (i = 0; i < field_count; i++) { if (*tmp_row) diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index 423ead89423..9a709f46c51 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -182,6 +182,7 @@ public: ulong *lengths; ulong *lengths_first; uint field_count; + uint record_size; bool cloned; spider_db_mysql_row(); ~spider_db_mysql_row(); @@ -210,6 +211,7 @@ public: TABLE *tmp_table, spider_string *str ); + uint get_byte_size(); }; class spider_db_mysql_result: public spider_db_result diff --git a/storage/spider/spd_db_oracle.cc b/storage/spider/spd_db_oracle.cc index dfeafc58f13..e5a68f1f8c1 100644 --- a/storage/spider/spd_db_oracle.cc +++ b/storage/spider/spd_db_oracle.cc @@ -519,6 +519,7 @@ SPIDER_DB_ROW *spider_db_oracle_row::clone() clone_row->db_conn = db_conn; clone_row->result = result; clone_row->field_count = field_count; + clone_row->record_size = record_size; clone_row->access_charset = access_charset; clone_row->cloned = TRUE; if (clone_row->init()) @@ -571,6 +572,13 @@ int spider_db_oracle_row::store_to_tmp_table( DBUG_RETURN(tmp_table->file->ha_write_row(tmp_table->record[0])); } +uint spider_db_oracle_row::get_byte_size() +{ + DBUG_ENTER("spider_db_oracle_row::get_byte_size"); + DBUG_PRINT("info",("spider this=%p", this)); + DBUG_RETURN(record_size); +} + int spider_db_oracle_row::init() { char *tmp_val; @@ -696,6 +704,7 @@ int spider_db_oracle_row::fetch() uint i; DBUG_ENTER("spider_db_oracle_row::fetch"); DBUG_PRINT("info",("spider this=%p", this)); + record_size = 0; for (i = 0; i < field_count; i++) { if (ind[i] == -1) @@ -757,6 +766,7 @@ int spider_db_oracle_row::fetch() } } row_size[i] = val_str[i].length(); + record_size += row_size[i]; } DBUG_RETURN(0); } @@ -911,6 +921,7 @@ SPIDER_DB_ROW *spider_db_oracle_result::fetch_row_from_tmp_table( str += row.row_size[i]; } } + row.record_size = tmp_str2.length(); DBUG_RETURN((SPIDER_DB_ROW *) &row); } diff --git a/storage/spider/spd_db_oracle.h b/storage/spider/spd_db_oracle.h index 9f9c75f0090..d0bd1757418 100644 --- a/storage/spider/spd_db_oracle.h +++ b/storage/spider/spd_db_oracle.h @@ -168,6 +168,7 @@ public: ub2 *coltp; ub2 *colsz; uint field_count; + uint record_size; ulong *row_size; ulong *row_size_first; CHARSET_INFO *access_charset; @@ -201,6 +202,7 @@ public: TABLE *tmp_table, spider_string *str ); + uint get_byte_size(); /* for oracle */ int init(); void deinit(); diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h index 38ded445d44..23bbff22fbb 100644 --- a/storage/spider/spd_include.h +++ b/storage/spider/spd_include.h @@ -960,6 +960,7 @@ typedef struct st_spider_share longlong priority; int quick_mode; longlong quick_page_size; + longlong quick_page_byte; int low_mem_read; int table_count_mode; int select_column_mode; diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc index a90f628603e..c10ed3aad80 100644 --- a/storage/spider/spd_param.cc +++ b/storage/spider/spd_param.cc @@ -1364,6 +1364,31 @@ longlong spider_param_quick_page_size( /* -1 :use table parameter + 0-:the limitation of memory size + */ +static MYSQL_THDVAR_LONGLONG( + quick_page_byte, /* name */ + PLUGIN_VAR_RQCMDARG, /* opt */ + "The limitation of memory size in a page when acquisition one by one", /* comment */ + NULL, /* check */ + NULL, /* update */ + -1, /* def */ + -1, /* min */ + 9223372036854775807LL, /* max */ + 0 /* blk */ +); + +longlong spider_param_quick_page_byte( + THD *thd, + longlong quick_page_byte +) { + DBUG_ENTER("spider_param_quick_page_byte"); + DBUG_RETURN(THDVAR(thd, quick_page_byte) < 0 ? + quick_page_byte : THDVAR(thd, quick_page_byte)); +} + +/* + -1 :use table parameter 0 :It doesn't use low memory mode. 1 :It uses low memory mode. */ @@ -3354,6 +3379,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = { MYSQL_SYSVAR(net_write_timeout), MYSQL_SYSVAR(quick_mode), MYSQL_SYSVAR(quick_page_size), + MYSQL_SYSVAR(quick_page_byte), MYSQL_SYSVAR(low_mem_read), MYSQL_SYSVAR(select_column_mode), #ifndef WITHOUT_SPIDER_BG_SEARCH diff --git a/storage/spider/spd_param.h b/storage/spider/spd_param.h index e615fc672d4..7919b0c4837 100644 --- a/storage/spider/spd_param.h +++ b/storage/spider/spd_param.h @@ -171,6 +171,10 @@ longlong spider_param_quick_page_size( THD *thd, longlong quick_page_size ); +longlong spider_param_quick_page_byte( + THD *thd, + longlong quick_page_byte +); int spider_param_low_mem_read( THD *thd, int low_mem_read diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 1f220b193e5..fe5265184b6 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -2045,6 +2045,7 @@ int spider_parse_connect_info( share->priority = -1; share->quick_mode = -1; share->quick_page_size = -1; + share->quick_page_byte = -1; share->low_mem_read = -1; share->table_count_mode = -1; share->select_column_mode = -1; @@ -2290,6 +2291,7 @@ int spider_parse_connect_info( SPIDER_PARAM_INT_WITH_MAX("qch", query_cache, 0, 2); SPIDER_PARAM_INT_WITH_MAX("qcs", query_cache_sync, 0, 3); SPIDER_PARAM_INT_WITH_MAX("qmd", quick_mode, 0, 3); + SPIDER_PARAM_LONGLONG("qpb", quick_page_byte, 0); SPIDER_PARAM_LONGLONG("qps", quick_page_size, 0); SPIDER_PARAM_INT_WITH_MAX("rom", read_only_mode, 0, 1); SPIDER_PARAM_DOUBLE("rrt", read_rate, 0); @@ -2459,6 +2461,7 @@ int spider_parse_connect_info( SPIDER_PARAM_LONGLONG("internal_offset", internal_offset, 0); SPIDER_PARAM_INT_WITH_MAX("reset_sql_alloc", reset_sql_alloc, 0, 1); SPIDER_PARAM_INT_WITH_MAX("semi_table_lock", semi_table_lock, 0, 1); + SPIDER_PARAM_LONGLONG("quick_page_byte", quick_page_byte, 0); SPIDER_PARAM_LONGLONG("quick_page_size", quick_page_size, 0); #ifndef WITHOUT_SPIDER_BG_SEARCH SPIDER_PARAM_LONGLONG("bgs_second_read", bgs_second_read, 0); @@ -3824,9 +3827,11 @@ int spider_set_connect_info_default( if (share->priority == -1) share->priority = 1000000; if (share->quick_mode == -1) - share->quick_mode = 0; + share->quick_mode = 3; if (share->quick_page_size == -1) - share->quick_page_size = 100; + share->quick_page_size = 1024; + if (share->quick_page_byte == -1) + share->quick_page_byte = 10485760; if (share->low_mem_read == -1) share->low_mem_read = 1; if (share->table_count_mode == -1) @@ -7997,6 +8002,8 @@ void spider_set_result_list_param( spider_param_quick_mode(thd, share->quick_mode); result_list->quick_page_size = spider_param_quick_page_size(thd, share->quick_page_size); + result_list->quick_page_byte = + spider_param_quick_page_byte(thd, share->quick_page_byte); result_list->low_mem_read = spider_param_low_mem_read(thd, share->low_mem_read); DBUG_VOID_RETURN; |