summaryrefslogtreecommitdiff
path: root/storage/spider/spd_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/spider/spd_table.cc')
-rw-r--r--storage/spider/spd_table.cc26
1 files changed, 24 insertions, 2 deletions
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 411c7ae675d..bb3cb139231 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2014 Kentoku Shiba
+/* Copyright (C) 2008-2015 Kentoku Shiba
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -773,6 +773,8 @@ int spider_free_share_alloc(
spider_free(spider_current_trx, share->net_write_timeouts, MYF(0));
if (share->access_balances)
spider_free(spider_current_trx, share->access_balances, MYF(0));
+ if (share->bka_table_name_types)
+ spider_free(spider_current_trx, share->bka_table_name_types, MYF(0));
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (share->monitoring_bg_interval)
spider_free(spider_current_trx, share->monitoring_bg_interval, MYF(0));
@@ -1989,6 +1991,8 @@ int spider_parse_connect_info(
SPIDER_PARAM_STR("bke", bka_engine);
SPIDER_PARAM_INT_WITH_MAX("bkm", bka_mode, 0, 2);
SPIDER_PARAM_INT("bsz", bulk_size, 0);
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("btt", bka_table_name_types,
+ 0, 1);
SPIDER_PARAM_INT_WITH_MAX("bum", bulk_update_mode, 0, 2);
SPIDER_PARAM_INT("bus", bulk_update_size, 0);
#ifndef WITHOUT_SPIDER_BG_SEARCH
@@ -2337,6 +2341,8 @@ int spider_parse_connect_info(
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
SPIDER_PARAM_LONGLONG("hs_result_free_size", hs_result_free_size, 0);
#endif
+ SPIDER_PARAM_LONG_LIST_WITH_MAX("bka_table_name_type",
+ bka_table_name_types, 0, 1);
error_num = ER_SPIDER_INVALID_CONNECT_INFO_NUM;
my_printf_error(error_num, ER_SPIDER_INVALID_CONNECT_INFO_STR,
MYF(0), tmp_ptr);
@@ -2484,6 +2490,8 @@ int spider_parse_connect_info(
share->all_link_count = share->net_write_timeouts_length;
if (share->all_link_count < share->access_balances_length)
share->all_link_count = share->access_balances_length;
+ if (share->all_link_count < share->bka_table_name_types_length)
+ share->all_link_count = share->bka_table_name_types_length;
if ((error_num = spider_increase_string_list(
&share->server_names,
&share->server_names_lengths,
@@ -2713,6 +2721,11 @@ int spider_parse_connect_info(
&share->access_balances_length,
share->all_link_count)))
goto error;
+ if ((error_num = spider_increase_long_list(
+ &share->bka_table_name_types,
+ &share->bka_table_name_types_length,
+ share->all_link_count)))
+ goto error;
/* copy for tables start */
share_alter = &share->alter_table;
@@ -3402,6 +3415,8 @@ int spider_set_connect_info_default(
share->net_write_timeouts[roop_count] = 600;
if (share->access_balances[roop_count] == -1)
share->access_balances[roop_count] = 100;
+ if (share->bka_table_name_types[roop_count] == -1)
+ share->bka_table_name_types[roop_count] = 0;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
@@ -7496,6 +7511,7 @@ void spider_set_tmp_share_pointer(
tmp_share->net_write_timeouts = &tmp_long[13];
tmp_long[13] = -1;
tmp_share->access_balances = &tmp_long[14];
+ tmp_share->bka_table_name_types = &tmp_long[15];
tmp_share->monitoring_limit = &tmp_longlong[0];
tmp_share->monitoring_sid = &tmp_longlong[1];
#ifndef WITHOUT_SPIDER_BG_SEARCH
@@ -7565,6 +7581,7 @@ void spider_set_tmp_share_pointer(
tmp_share->net_read_timeouts_length = 1;
tmp_share->net_write_timeouts_length = 1;
tmp_share->access_balances_length = 1;
+ tmp_share->bka_table_name_types_length = 1;
#ifndef WITHOUT_SPIDER_BG_SEARCH
tmp_share->monitoring_bg_kind[0] = -1;
@@ -8132,10 +8149,15 @@ bool spider_check_index_merge(
DBUG_PRINT("info",("spider join is null"));
DBUG_RETURN(FALSE);
}
+ if (!join->join_tab)
+ {
+ DBUG_PRINT("info",("spider join->join_tab is null"));
+ DBUG_RETURN(FALSE);
+ }
for (roop_count = 0; roop_count < spider_join_table_count(join); ++roop_count)
{
JOIN_TAB *join_tab = &join->join_tab[roop_count];
- if (join_tab && join_tab->table == table)
+ if (join_tab->table == table)
{
DBUG_PRINT("info",("spider join_tab->type=%u", join_tab->type));
if (