Commit 6458e115 authored by Kentoku SHIBA's avatar Kentoku SHIBA

add spider_bka_mode=2

parent 38c94765
This diff is collapsed.
......@@ -818,6 +818,10 @@ class ha_spider: public handler
const key_range *start_key
);
int reuse_tmp_table_and_sql_for_bka();
int append_union_table_and_sql_for_bka(
const key_range *start_key
);
int reuse_union_table_and_sql_for_bka();
int append_insert_sql_part();
int append_update_sql_part();
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
......@@ -878,10 +882,20 @@ class ha_spider: public handler
int append_values_terminator_sql_part(
ulong sql_type
);
int append_union_table_connector_sql_part(
ulong sql_type
);
int append_union_table_terminator_sql_part(
ulong sql_type
);
int append_key_column_values_sql_part(
const key_range *start_key,
ulong sql_type
);
int append_key_column_values_with_name_sql_part(
const key_range *start_key,
ulong sql_type
);
int append_key_where_sql_part(
const key_range *start_key,
const key_range *end_key,
......@@ -983,6 +997,10 @@ class ha_spider: public handler
uint multi_range_cnt,
bool with_comma
);
int append_multi_range_cnt_with_name_sql_part(
ulong sql_type,
uint multi_range_cnt
);
int append_delete_all_rows_sql_part(
ulong sql_type
);
......
......@@ -2293,7 +2293,7 @@ void *spider_bg_conn_action(
spider_db_set_names(spider, conn, conn->link_idx)))
{
if (
result_list->tmp_table_join &&
result_list->tmp_table_join && spider->bka_mode != 2 &&
spider_bit_is_set(result_list->tmp_table_join_first,
conn->link_idx)
) {
......
......@@ -3823,6 +3823,23 @@ int spider_handlersocket_handler::reuse_tmp_table_and_sql_for_bka()
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_union_table_and_sql_for_bka(
const key_range *start_key
) {
DBUG_ENTER("spider_handlersocket_handler::append_union_table_and_sql_for_bka");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_ASSERT(0);
DBUG_RETURN(0);
}
int spider_handlersocket_handler::reuse_union_table_and_sql_for_bka()
{
DBUG_ENTER("spider_handlersocket_handler::reuse_union_table_and_sql_for_bka");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_ASSERT(0);
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_insert_for_recovery(
ulong sql_type,
int link_idx
......@@ -4131,6 +4148,24 @@ int spider_handlersocket_handler::append_values_terminator_part(
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_union_table_connector_part(
ulong sql_type
) {
DBUG_ENTER("spider_handlersocket_handler::append_union_table_connector_part");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_ASSERT(0);
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_union_table_terminator_part(
ulong sql_type
) {
DBUG_ENTER("spider_handlersocket_handler::append_union_table_terminator_part");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_ASSERT(0);
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_key_column_values_part(
const key_range *start_key,
ulong sql_type
......@@ -4141,6 +4176,16 @@ int spider_handlersocket_handler::append_key_column_values_part(
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_key_column_values_with_name_part(
const key_range *start_key,
ulong sql_type
) {
DBUG_ENTER("spider_handlersocket_handler::append_key_column_values_with_name_part");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_ASSERT(0);
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_key_where_part(
const key_range *start_key,
const key_range *end_key,
......@@ -4400,6 +4445,16 @@ int spider_handlersocket_handler::append_multi_range_cnt_part(
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_multi_range_cnt_with_name_part(
ulong sql_type,
uint multi_range_cnt
) {
DBUG_ENTER("spider_handlersocket_handler::append_multi_range_cnt_with_name_part");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_ASSERT(0);
DBUG_RETURN(0);
}
int spider_handlersocket_handler::append_open_handler_part(
ulong sql_type,
uint handler_id,
......
......@@ -495,6 +495,10 @@ class spider_handlersocket_handler: public spider_db_handler
const key_range *start_key
);
int reuse_tmp_table_and_sql_for_bka();
int append_union_table_and_sql_for_bka(
const key_range *start_key
);
int reuse_union_table_and_sql_for_bka();
int append_insert_for_recovery(
ulong sql_type,
int link_idx
......@@ -577,10 +581,20 @@ class spider_handlersocket_handler: public spider_db_handler
int append_values_terminator_part(
ulong sql_type
);
int append_union_table_connector_part(
ulong sql_type
);
int append_union_table_terminator_part(
ulong sql_type
);
int append_key_column_values_part(
const key_range *start_key,
ulong sql_type
);
int append_key_column_values_with_name_part(
const key_range *start_key,
ulong sql_type
);
int append_key_where_part(
const key_range *start_key,
const key_range *end_key,
......@@ -679,6 +693,10 @@ class spider_handlersocket_handler: public spider_db_handler
uint multi_range_cnt,
bool with_comma
);
int append_multi_range_cnt_with_name_part(
ulong sql_type,
uint multi_range_cnt
);
int append_open_handler_part(
ulong sql_type,
uint handler_id,
......
......@@ -998,6 +998,10 @@ class spider_db_handler
const key_range *start_key
) = 0;
virtual int reuse_tmp_table_and_sql_for_bka() = 0;
virtual int append_union_table_and_sql_for_bka(
const key_range *start_key
) = 0;
virtual int reuse_union_table_and_sql_for_bka() = 0;
virtual int append_insert_for_recovery(
ulong sql_type,
int link_idx
......@@ -1072,10 +1076,20 @@ class spider_db_handler
virtual int append_values_terminator_part(
ulong sql_type
) = 0;
virtual int append_union_table_connector_part(
ulong sql_type
) = 0;
virtual int append_union_table_terminator_part(
ulong sql_type
) = 0;
virtual int append_key_column_values_part(
const key_range *start_key,
ulong sql_type
) = 0;
virtual int append_key_column_values_with_name_part(
const key_range *start_key,
ulong sql_type
) = 0;
virtual int append_key_where_part(
const key_range *start_key,
const key_range *end_key,
......@@ -1155,6 +1169,10 @@ class spider_db_handler
uint multi_range_cnt,
bool with_comma
) = 0;
virtual int append_multi_range_cnt_with_name_part(
ulong sql_type,
uint multi_range_cnt
) = 0;
virtual int append_open_handler_part(
ulong sql_type,
uint handler_id,
......
This diff is collapsed.
......@@ -577,6 +577,10 @@ class spider_mysql_handler: public spider_db_handler
int tmp_table_name_length,
int *db_name_pos
);
int append_union_table_and_sql_for_bka(
const key_range *start_key
);
int reuse_union_table_and_sql_for_bka();
int append_insert_for_recovery(
ulong sql_type,
int link_idx
......@@ -721,6 +725,18 @@ class spider_mysql_handler: public spider_db_handler
int append_values_terminator(
spider_string *str
);
int append_union_table_connector_part(
ulong sql_type
);
int append_union_table_connector(
spider_string *str
);
int append_union_table_terminator_part(
ulong sql_type
);
int append_union_table_terminator(
spider_string *str
);
int append_key_column_values_part(
const key_range *start_key,
ulong sql_type
......@@ -729,6 +745,14 @@ class spider_mysql_handler: public spider_db_handler
spider_string *str,
const key_range *start_key
);
int append_key_column_values_with_name_part(
const key_range *start_key,
ulong sql_type
);
int append_key_column_values_with_name(
spider_string *str,
const key_range *start_key
);
int append_key_where_part(
const key_range *start_key,
const key_range *end_key,
......@@ -909,6 +933,14 @@ class spider_mysql_handler: public spider_db_handler
uint multi_range_cnt,
bool with_comma
);
int append_multi_range_cnt_with_name_part(
ulong sql_type,
uint multi_range_cnt
);
int append_multi_range_cnt_with_name(
spider_string *str,
uint multi_range_cnt
);
int append_open_handler_part(
ulong sql_type,
uint handler_id,
......
This diff is collapsed.
......@@ -660,6 +660,10 @@ class spider_oracle_handler: public spider_db_handler
int tmp_table_name_length,
int *db_name_pos
);
int append_union_table_and_sql_for_bka(
const key_range *start_key
);
int reuse_union_table_and_sql_for_bka();
int append_insert_for_recovery(
ulong sql_type,
int link_idx
......@@ -804,6 +808,18 @@ class spider_oracle_handler: public spider_db_handler
int append_values_terminator(
spider_string *str
);
int append_union_table_connector_part(
ulong sql_type
);
int append_union_table_connector(
spider_string *str
);
int append_union_table_terminator_part(
ulong sql_type
);
int append_union_table_terminator(
spider_string *str
);
int append_key_column_values_part(
const key_range *start_key,
ulong sql_type
......@@ -812,6 +828,14 @@ class spider_oracle_handler: public spider_db_handler
spider_string *str,
const key_range *start_key
);
int append_key_column_values_with_name_part(
const key_range *start_key,
ulong sql_type
);
int append_key_column_values_with_name(
spider_string *str,
const key_range *start_key
);
int append_key_where_part(
const key_range *start_key,
const key_range *end_key,
......@@ -992,6 +1016,14 @@ class spider_oracle_handler: public spider_db_handler
uint multi_range_cnt,
bool with_comma
);
int append_multi_range_cnt_with_name_part(
ulong sql_type,
uint multi_range_cnt
);
int append_multi_range_cnt_with_name(
spider_string *str,
uint multi_range_cnt
);
int append_open_handler_part(
ulong sql_type,
uint handler_id,
......
......@@ -118,7 +118,7 @@
#define SPIDER_TMP_SHARE_LONG_COUNT 15
#define SPIDER_TMP_SHARE_LONGLONG_COUNT 3
#define SPIDER_MEM_CALC_LIST_NUM 233
#define SPIDER_MEM_CALC_LIST_NUM 235
#define SPIDER_BACKUP_DASTATUS \
bool da_status; if (thd) da_status = thd->is_error(); else da_status = FALSE;
......
......@@ -2356,7 +2356,7 @@ static MYSQL_THDVAR_INT(
NULL, /* update */
-1, /* def */
-1, /* min */
1, /* max */
2, /* max */
0 /* blk */
);
......
......@@ -1900,7 +1900,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_LONGLONG("bsr", bgs_second_read, 0);
#endif
SPIDER_PARAM_STR("bke", bka_engine);
SPIDER_PARAM_INT_WITH_MAX("bkm", bka_mode, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("bkm", bka_mode, 0, 2);
SPIDER_PARAM_INT("bsz", bulk_size, 0);
SPIDER_PARAM_INT_WITH_MAX("bum", bulk_update_mode, 0, 2);
SPIDER_PARAM_INT("bus", bulk_update_size, 0);
......@@ -2056,7 +2056,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_INT("bgs_mode", bgs_mode, 0);
#endif
SPIDER_PARAM_STR_LIST("ssl_cert", tgt_ssl_certs);
SPIDER_PARAM_INT_WITH_MAX("bka_mode", bka_mode, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("bka_mode", bka_mode, 0, 2);
error_num = ER_SPIDER_INVALID_CONNECT_INFO_NUM;
my_printf_error(error_num, ER_SPIDER_INVALID_CONNECT_INFO_STR,
MYF(0), tmp_ptr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment