Commit 00ae4272 authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

MDEV-27642 Spider: remove #ifdef WITHOUT_SPIDER_BG_SEARCH

parent cfd145fa
This diff is collapsed.
...@@ -58,7 +58,6 @@ pthread_mutex_t spider_conn_id_mutex; ...@@ -58,7 +58,6 @@ pthread_mutex_t spider_conn_id_mutex;
pthread_mutex_t spider_ipport_conn_mutex; pthread_mutex_t spider_ipport_conn_mutex;
ulonglong spider_conn_id = 1; ulonglong spider_conn_id = 1;
#ifndef WITHOUT_SPIDER_BG_SEARCH
extern pthread_attr_t spider_pt_attr; extern pthread_attr_t spider_pt_attr;
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
...@@ -66,7 +65,6 @@ extern PSI_mutex_key spd_key_mutex_mta_conn; ...@@ -66,7 +65,6 @@ extern PSI_mutex_key spd_key_mutex_mta_conn;
extern PSI_mutex_key spd_key_mutex_conn_i; extern PSI_mutex_key spd_key_mutex_conn_i;
extern PSI_mutex_key spd_key_mutex_conn_loop_check; extern PSI_mutex_key spd_key_mutex_conn_loop_check;
extern PSI_cond_key spd_key_cond_conn_i; extern PSI_cond_key spd_key_cond_conn_i;
#ifndef WITHOUT_SPIDER_BG_SEARCH
extern PSI_mutex_key spd_key_mutex_bg_conn_chain; extern PSI_mutex_key spd_key_mutex_bg_conn_chain;
extern PSI_mutex_key spd_key_mutex_bg_conn_sync; extern PSI_mutex_key spd_key_mutex_bg_conn_sync;
extern PSI_mutex_key spd_key_mutex_bg_conn; extern PSI_mutex_key spd_key_mutex_bg_conn;
...@@ -85,8 +83,6 @@ extern PSI_thread_key spd_key_thd_bg_sts; ...@@ -85,8 +83,6 @@ extern PSI_thread_key spd_key_thd_bg_sts;
extern PSI_thread_key spd_key_thd_bg_crd; extern PSI_thread_key spd_key_thd_bg_crd;
extern PSI_thread_key spd_key_thd_bg_mon; extern PSI_thread_key spd_key_thd_bg_mon;
#endif #endif
#endif
#endif
/* UTC time zone for timestamp columns */ /* UTC time zone for timestamp columns */
extern Time_zone *UTC; extern Time_zone *UTC;
...@@ -268,9 +264,7 @@ int spider_free_conn_alloc( ...@@ -268,9 +264,7 @@ int spider_free_conn_alloc(
SPIDER_CONN *conn SPIDER_CONN *conn
) { ) {
DBUG_ENTER("spider_free_conn_alloc"); DBUG_ENTER("spider_free_conn_alloc");
#ifndef WITHOUT_SPIDER_BG_SEARCH
spider_free_conn_thread(conn); spider_free_conn_thread(conn);
#endif
spider_db_disconnect(conn); spider_db_disconnect(conn);
if (conn->db_conn) if (conn->db_conn)
{ {
...@@ -1823,7 +1817,6 @@ SPIDER_CONN *spider_tree_delete( ...@@ -1823,7 +1817,6 @@ SPIDER_CONN *spider_tree_delete(
DBUG_RETURN(top); DBUG_RETURN(top);
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_set_conn_bg_param( int spider_set_conn_bg_param(
ha_spider *spider ha_spider *spider
) { ) {
...@@ -2070,10 +2063,8 @@ void spider_bg_all_conn_wait( ...@@ -2070,10 +2063,8 @@ void spider_bg_all_conn_wait(
SPIDER_LINK_STATUS_RECOVERY) SPIDER_LINK_STATUS_RECOVERY)
) { ) {
conn = spider->conns[roop_count]; conn = spider->conns[roop_count];
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (conn && result_list->bgs_working) if (conn && result_list->bgs_working)
spider_bg_conn_wait(conn); spider_bg_conn_wait(conn);
#endif
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -2082,13 +2073,10 @@ int spider_bg_all_conn_pre_next( ...@@ -2082,13 +2073,10 @@ int spider_bg_all_conn_pre_next(
ha_spider *spider, ha_spider *spider,
int link_idx int link_idx
) { ) {
#ifndef WITHOUT_SPIDER_BG_SEARCH
int roop_start, roop_end, roop_count, lock_mode, link_ok, error_num; int roop_start, roop_end, roop_count, lock_mode, link_ok, error_num;
SPIDER_RESULT_LIST *result_list = &spider->result_list; SPIDER_RESULT_LIST *result_list = &spider->result_list;
SPIDER_SHARE *share = spider->share; SPIDER_SHARE *share = spider->share;
#endif
DBUG_ENTER("spider_bg_all_conn_pre_next"); DBUG_ENTER("spider_bg_all_conn_pre_next");
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (result_list->bgs_phase > 0) if (result_list->bgs_phase > 0)
{ {
lock_mode = spider_conn_lock_mode(spider); lock_mode = spider_conn_lock_mode(spider);
...@@ -2118,7 +2106,6 @@ int spider_bg_all_conn_pre_next( ...@@ -2118,7 +2106,6 @@ int spider_bg_all_conn_pre_next(
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
} }
#endif
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -2164,10 +2151,8 @@ void spider_bg_all_conn_break( ...@@ -2164,10 +2151,8 @@ void spider_bg_all_conn_break(
SPIDER_LINK_STATUS_RECOVERY) SPIDER_LINK_STATUS_RECOVERY)
) { ) {
conn = spider->conns[roop_count]; conn = spider->conns[roop_count];
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (conn && result_list->bgs_working) if (conn && result_list->bgs_working)
spider_bg_conn_break(conn, spider); spider_bg_conn_break(conn, spider);
#endif
if (spider->quick_targets[roop_count]) if (spider->quick_targets[roop_count])
{ {
spider_db_free_one_quick_result((SPIDER_RESULT *) result_list->current); spider_db_free_one_quick_result((SPIDER_RESULT *) result_list->current);
...@@ -3947,7 +3932,6 @@ void *spider_bg_mon_action( ...@@ -3947,7 +3932,6 @@ void *spider_bg_mon_action(
} }
} }
} }
#endif
int spider_conn_first_link_idx( int spider_conn_first_link_idx(
THD *thd, THD *thd,
......
...@@ -256,7 +256,6 @@ SPIDER_CONN *spider_tree_delete( ...@@ -256,7 +256,6 @@ SPIDER_CONN *spider_tree_delete(
SPIDER_CONN *top SPIDER_CONN *top
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_set_conn_bg_param( int spider_set_conn_bg_param(
ha_spider *spider ha_spider *spider
); );
...@@ -353,7 +352,6 @@ void spider_free_mon_threads( ...@@ -353,7 +352,6 @@ void spider_free_mon_threads(
void *spider_bg_mon_action( void *spider_bg_mon_action(
void *arg void *arg
); );
#endif
int spider_conn_first_link_idx( int spider_conn_first_link_idx(
THD *thd, THD *thd,
......
...@@ -68,10 +68,8 @@ int spider_udf_set_copy_tables_param_default( ...@@ -68,10 +68,8 @@ int spider_udf_set_copy_tables_param_default(
copy_tables->use_table_charset = 1; copy_tables->use_table_charset = 1;
if (copy_tables->use_transaction == -1) if (copy_tables->use_transaction == -1)
copy_tables->use_transaction = 1; copy_tables->use_transaction = 1;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (copy_tables->bg_mode == -1) if (copy_tables->bg_mode == -1)
copy_tables->bg_mode = 0; copy_tables->bg_mode = 0;
#endif
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -221,9 +219,7 @@ int spider_udf_parse_copy_tables_param( ...@@ -221,9 +219,7 @@ int spider_udf_parse_copy_tables_param(
copy_tables->bulk_insert_rows = -1; copy_tables->bulk_insert_rows = -1;
copy_tables->use_table_charset = -1; copy_tables->use_table_charset = -1;
copy_tables->use_transaction = -1; copy_tables->use_transaction = -1;
#ifndef WITHOUT_SPIDER_BG_SEARCH
copy_tables->bg_mode = -1; copy_tables->bg_mode = -1;
#endif
if (param_length == 0) if (param_length == 0)
goto set_default; goto set_default;
...@@ -276,9 +272,7 @@ int spider_udf_parse_copy_tables_param( ...@@ -276,9 +272,7 @@ int spider_udf_parse_copy_tables_param(
goto error; goto error;
continue; continue;
case 3: case 3:
#ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_PARAM_INT_WITH_MAX("bgm", bg_mode, 0, 1); SPIDER_PARAM_INT_WITH_MAX("bgm", bg_mode, 0, 1);
#endif
SPIDER_PARAM_INT("bii", bulk_insert_interval, 0); SPIDER_PARAM_INT("bii", bulk_insert_interval, 0);
SPIDER_PARAM_LONGLONG("bir", bulk_insert_rows, 1); SPIDER_PARAM_LONGLONG("bir", bulk_insert_rows, 1);
SPIDER_PARAM_STR("dtb", database); SPIDER_PARAM_STR("dtb", database);
...@@ -286,12 +280,10 @@ int spider_udf_parse_copy_tables_param( ...@@ -286,12 +280,10 @@ int spider_udf_parse_copy_tables_param(
SPIDER_PARAM_INT_WITH_MAX("utr", use_transaction, 0, 1); SPIDER_PARAM_INT_WITH_MAX("utr", use_transaction, 0, 1);
error_num = param_string_parse.print_param_error(); error_num = param_string_parse.print_param_error();
goto error; goto error;
#ifndef WITHOUT_SPIDER_BG_SEARCH
case 7: case 7:
SPIDER_PARAM_INT_WITH_MAX("bg_mode", bg_mode, 0, 1); SPIDER_PARAM_INT_WITH_MAX("bg_mode", bg_mode, 0, 1);
error_num = param_string_parse.print_param_error(); error_num = param_string_parse.print_param_error();
goto error; goto error;
#endif
case 8: case 8:
SPIDER_PARAM_STR("database", database); SPIDER_PARAM_STR("database", database);
error_num = param_string_parse.print_param_error(); error_num = param_string_parse.print_param_error();
...@@ -782,7 +774,6 @@ int spider_udf_copy_tables_create_table_list( ...@@ -782,7 +774,6 @@ int spider_udf_copy_tables_create_table_list(
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_udf_bg_copy_exec_sql( int spider_udf_bg_copy_exec_sql(
SPIDER_COPY_TABLE_CONN *table_conn SPIDER_COPY_TABLE_CONN *table_conn
) { ) {
...@@ -811,7 +802,6 @@ int spider_udf_bg_copy_exec_sql( ...@@ -811,7 +802,6 @@ int spider_udf_bg_copy_exec_sql(
conn->bg_caller_sync_wait = FALSE; conn->bg_caller_sync_wait = FALSE;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#endif
long long spider_copy_tables_body( long long spider_copy_tables_body(
UDF_INIT *initid, UDF_INIT *initid,
......
...@@ -48,8 +48,6 @@ int spider_udf_copy_tables_create_table_list( ...@@ -48,8 +48,6 @@ int spider_udf_copy_tables_create_table_list(
uint dst_link_idx_list_length uint dst_link_idx_list_length
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_udf_bg_copy_exec_sql( int spider_udf_bg_copy_exec_sql(
SPIDER_COPY_TABLE_CONN *table_conn SPIDER_COPY_TABLE_CONN *table_conn
); );
#endif
...@@ -583,10 +583,8 @@ int spider_db_before_query( ...@@ -583,10 +583,8 @@ int spider_db_before_query(
int error_num; int error_num;
DBUG_ENTER("spider_db_before_query"); DBUG_ENTER("spider_db_before_query");
DBUG_ASSERT(need_mon); DBUG_ASSERT(need_mon);
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (conn->bg_search) if (conn->bg_search)
spider_bg_conn_break(conn, NULL); spider_bg_conn_break(conn, NULL);
#endif
conn->in_before_query = TRUE; conn->in_before_query = TRUE;
pthread_mutex_assert_owner(&conn->mta_conn_mutex); pthread_mutex_assert_owner(&conn->mta_conn_mutex);
DBUG_ASSERT(conn->mta_conn_mutex_file_pos.file_name); DBUG_ASSERT(conn->mta_conn_mutex_file_pos.file_name);
...@@ -3607,9 +3605,7 @@ int spider_db_free_result( ...@@ -3607,9 +3605,7 @@ int spider_db_free_result(
DBUG_PRINT("info",("spider result_list->finish_flg = FALSE")); DBUG_PRINT("info",("spider result_list->finish_flg = FALSE"));
result_list->finish_flg = FALSE; result_list->finish_flg = FALSE;
result_list->quick_phase = 0; result_list->quick_phase = 0;
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase = 0; result_list->bgs_phase = 0;
#endif
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -3671,9 +3667,7 @@ int spider_db_store_result( ...@@ -3671,9 +3667,7 @@ int spider_db_store_result(
current = (SPIDER_RESULT*) result_list->current; current = (SPIDER_RESULT*) result_list->current;
} else { } else {
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase > 0 || result_list->bgs_phase > 0 ||
#endif
result_list->quick_phase > 0 result_list->quick_phase > 0
) { ) {
if (result_list->bgs_current == result_list->last) if (result_list->bgs_current == result_list->last)
...@@ -3701,9 +3695,7 @@ int spider_db_store_result( ...@@ -3701,9 +3695,7 @@ int spider_db_store_result(
result_list->bgs_current = result_list->bgs_current->next; result_list->bgs_current = result_list->bgs_current->next;
} }
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase == 1 || result_list->bgs_phase == 1 ||
#endif
result_list->quick_phase == 2 result_list->quick_phase == 2
) { ) {
if (result_list->low_mem_read && if (result_list->low_mem_read &&
...@@ -3788,15 +3780,11 @@ int spider_db_store_result( ...@@ -3788,15 +3780,11 @@ int spider_db_store_result(
DBUG_PRINT("info",("spider result_list->finish_flg = TRUE")); DBUG_PRINT("info",("spider result_list->finish_flg = TRUE"));
current->finish_flg = TRUE; current->finish_flg = TRUE;
result_list->finish_flg = TRUE; result_list->finish_flg = TRUE;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (result_list->bgs_phase <= 1) if (result_list->bgs_phase <= 1)
{ {
#endif
result_list->current_row_num = 0; result_list->current_row_num = 0;
table->status = STATUS_NOT_FOUND; table->status = STATUS_NOT_FOUND;
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
if (!conn->mta_conn_mutex_unlock_later && !call_db_errorno) if (!conn->mta_conn_mutex_unlock_later && !call_db_errorno)
{ {
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
...@@ -3832,14 +3820,10 @@ int spider_db_store_result( ...@@ -3832,14 +3820,10 @@ int spider_db_store_result(
current->finish_flg = TRUE; current->finish_flg = TRUE;
result_list->finish_flg = TRUE; result_list->finish_flg = TRUE;
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (result_list->bgs_phase <= 1) if (result_list->bgs_phase <= 1)
{ {
#endif
result_list->current_row_num = 0; result_list->current_row_num = 0;
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
} }
} else { } else {
/* has_result() for case of result with result_tmp_tbl */ /* has_result() for case of result with result_tmp_tbl */
...@@ -3910,9 +3894,7 @@ int spider_db_store_result( ...@@ -3910,9 +3894,7 @@ int spider_db_store_result(
conn->quick_target = NULL; conn->quick_target = NULL;
spider->quick_targets[link_idx] = NULL; spider->quick_targets[link_idx] = NULL;
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase <= 1 && result_list->bgs_phase <= 1 &&
#endif
result_list->quick_phase == 0 result_list->quick_phase == 0
) { ) {
result_list->current_row_num = 0; result_list->current_row_num = 0;
...@@ -4088,14 +4070,10 @@ int spider_db_store_result( ...@@ -4088,14 +4070,10 @@ int spider_db_store_result(
spider->quick_targets[link_idx] = NULL; spider->quick_targets[link_idx] = NULL;
} }
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
DBUG_PRINT("info", ("spider bgs_phase=%d", result_list->bgs_phase)); DBUG_PRINT("info", ("spider bgs_phase=%d", result_list->bgs_phase));
#endif
DBUG_PRINT("info", ("spider quick_phase=%d", result_list->quick_phase)); DBUG_PRINT("info", ("spider quick_phase=%d", result_list->quick_phase));
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase <= 1 && result_list->bgs_phase <= 1 &&
#endif
result_list->quick_phase == 0 result_list->quick_phase == 0
) { ) {
result_list->current_row_num = 0; result_list->current_row_num = 0;
...@@ -4154,9 +4132,7 @@ int spider_db_store_result_for_reuse_cursor( ...@@ -4154,9 +4132,7 @@ int spider_db_store_result_for_reuse_cursor(
current = (SPIDER_RESULT*) result_list->current; current = (SPIDER_RESULT*) result_list->current;
} else { } else {
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase > 0 || result_list->bgs_phase > 0 ||
#endif
result_list->quick_phase > 0 result_list->quick_phase > 0
) { ) {
if (result_list->bgs_current == result_list->last) if (result_list->bgs_current == result_list->last)
...@@ -4178,9 +4154,7 @@ int spider_db_store_result_for_reuse_cursor( ...@@ -4178,9 +4154,7 @@ int spider_db_store_result_for_reuse_cursor(
result_list->bgs_current = result_list->bgs_current->next; result_list->bgs_current = result_list->bgs_current->next;
} }
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase == 1 || result_list->bgs_phase == 1 ||
#endif
result_list->quick_phase == 2 result_list->quick_phase == 2
) { ) {
result_list->current = result_list->bgs_current; result_list->current = result_list->bgs_current;
...@@ -4240,14 +4214,10 @@ int spider_db_store_result_for_reuse_cursor( ...@@ -4240,14 +4214,10 @@ int spider_db_store_result_for_reuse_cursor(
current->finish_flg = TRUE; current->finish_flg = TRUE;
result_list->finish_flg = TRUE; result_list->finish_flg = TRUE;
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (result_list->bgs_phase <= 1) if (result_list->bgs_phase <= 1)
{ {
#endif
result_list->current_row_num = 0; result_list->current_row_num = 0;
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
} else { } else {
DBUG_ASSERT(current->prev); DBUG_ASSERT(current->prev);
DBUG_ASSERT(current->prev->result); DBUG_ASSERT(current->prev->result);
...@@ -4286,9 +4256,7 @@ int spider_db_store_result_for_reuse_cursor( ...@@ -4286,9 +4256,7 @@ int spider_db_store_result_for_reuse_cursor(
conn->quick_target = NULL; conn->quick_target = NULL;
spider->quick_targets[link_idx] = NULL; spider->quick_targets[link_idx] = NULL;
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase <= 1 && result_list->bgs_phase <= 1 &&
#endif
result_list->quick_phase == 0 result_list->quick_phase == 0
) { ) {
result_list->current_row_num = 0; result_list->current_row_num = 0;
...@@ -4461,14 +4429,10 @@ int spider_db_store_result_for_reuse_cursor( ...@@ -4461,14 +4429,10 @@ int spider_db_store_result_for_reuse_cursor(
spider->quick_targets[link_idx] = NULL; spider->quick_targets[link_idx] = NULL;
} }
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
DBUG_PRINT("info", ("spider bgs_phase=%d", result_list->bgs_phase)); DBUG_PRINT("info", ("spider bgs_phase=%d", result_list->bgs_phase));
#endif
DBUG_PRINT("info", ("spider quick_phase=%d", result_list->quick_phase)); DBUG_PRINT("info", ("spider quick_phase=%d", result_list->quick_phase));
if ( if (
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_phase <= 1 && result_list->bgs_phase <= 1 &&
#endif
result_list->quick_phase == 0 result_list->quick_phase == 0
) { ) {
result_list->current_row_num = 0; result_list->current_row_num = 0;
...@@ -4684,7 +4648,6 @@ int spider_db_seek_next( ...@@ -4684,7 +4648,6 @@ int spider_db_seek_next(
} }
#endif #endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (result_list->bgs_phase > 0) if (result_list->bgs_phase > 0)
{ {
#ifdef SPIDER_HAS_GROUP_BY_HANDLER #ifdef SPIDER_HAS_GROUP_BY_HANDLER
...@@ -4728,7 +4691,6 @@ int spider_db_seek_next( ...@@ -4728,7 +4691,6 @@ int spider_db_seek_next(
} }
#endif #endif
} else { } else {
#endif
if (result_list->current == result_list->bgs_current) if (result_list->current == result_list->bgs_current)
{ {
if (result_list->finish_flg) if (result_list->finish_flg)
...@@ -5102,9 +5064,7 @@ int spider_db_seek_next( ...@@ -5102,9 +5064,7 @@ int spider_db_seek_next(
DBUG_RETURN(HA_ERR_END_OF_FILE); DBUG_RETURN(HA_ERR_END_OF_FILE);
} }
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
DBUG_RETURN(spider_db_fetch(buf, spider, table)); DBUG_RETURN(spider_db_fetch(buf, spider, table));
} else } else
DBUG_RETURN(spider_db_fetch(buf, spider, table)); DBUG_RETURN(spider_db_fetch(buf, spider, table));
...@@ -11311,7 +11271,6 @@ int spider_db_udf_copy_tables( ...@@ -11311,7 +11271,6 @@ int spider_db_udf_copy_tables(
} }
} }
*/ */
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (copy_tables->bg_mode) if (copy_tables->bg_mode)
{ {
for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn; for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn;
...@@ -11325,7 +11284,6 @@ int spider_db_udf_copy_tables( ...@@ -11325,7 +11284,6 @@ int spider_db_udf_copy_tables(
} }
} }
} else { } else {
#endif
for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn; for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn;
dst_tbl_conn = dst_tbl_conn->next) dst_tbl_conn = dst_tbl_conn->next)
{ {
...@@ -11364,11 +11322,8 @@ int spider_db_udf_copy_tables( ...@@ -11364,11 +11322,8 @@ int spider_db_udf_copy_tables(
pthread_mutex_unlock(&tmp_conn->mta_conn_mutex); pthread_mutex_unlock(&tmp_conn->mta_conn_mutex);
} }
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (copy_tables->bg_mode) if (copy_tables->bg_mode)
{ {
for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn; for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn;
...@@ -11391,7 +11346,6 @@ int spider_db_udf_copy_tables( ...@@ -11391,7 +11346,6 @@ int spider_db_udf_copy_tables(
} }
} }
} }
#endif
} }
if (copy_tables->use_transaction) if (copy_tables->use_transaction)
...@@ -11437,7 +11391,6 @@ int spider_db_udf_copy_tables( ...@@ -11437,7 +11391,6 @@ int spider_db_udf_copy_tables(
DBUG_RETURN(0); DBUG_RETURN(0);
error_db_query: error_db_query:
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (copy_tables->bg_mode) if (copy_tables->bg_mode)
{ {
for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn; for (dst_tbl_conn = copy_tables->table_conn[1]; dst_tbl_conn;
...@@ -11452,7 +11405,6 @@ int spider_db_udf_copy_tables( ...@@ -11452,7 +11405,6 @@ int spider_db_udf_copy_tables(
} }
} }
} }
#endif
error_unlock_tables: error_unlock_tables:
error_commit: error_commit:
error_lock_tables: error_lock_tables:
......
...@@ -1790,13 +1790,9 @@ typedef struct st_spider_result ...@@ -1790,13 +1790,9 @@ typedef struct st_spider_result
{ {
uint dbton_id; uint dbton_id;
SPIDER_DB_RESULT *result; SPIDER_DB_RESULT *result;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
st_spider_result *prev; st_spider_result *prev;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
st_spider_result *next; st_spider_result *next;
SPIDER_POSITION *first_position; /* for quick mode */ SPIDER_POSITION *first_position; /* for quick mode */
int pos_page_size; /* for quick mode */ int pos_page_size; /* for quick mode */
...@@ -1815,17 +1811,11 @@ typedef struct st_spider_result ...@@ -1815,17 +1811,11 @@ typedef struct st_spider_result
typedef struct st_spider_result_list typedef struct st_spider_result_list
{ {
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
SPIDER_RESULT *first; SPIDER_RESULT *first;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
SPIDER_RESULT *last; SPIDER_RESULT *last;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
SPIDER_RESULT *current; SPIDER_RESULT *current;
KEY *key_info; KEY *key_info;
int key_order; int key_order;
...@@ -1889,14 +1879,11 @@ typedef struct st_spider_result_list ...@@ -1889,14 +1879,11 @@ typedef struct st_spider_result_list
longlong second_read; longlong second_read;
int set_split_read_count; int set_split_read_count;
int *casual_read; int *casual_read;
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* 0:nomal 1:store 2:store end */ /* 0:nomal 1:store 2:store end */
volatile volatile
#endif
int quick_phase; int quick_phase;
bool keyread; bool keyread;
TABLE *table; TABLE *table;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile int bgs_error; volatile int bgs_error;
bool bgs_error_with_message; bool bgs_error_with_message;
char bgs_error_msg[MYSQL_ERRMSG_SIZE]; char bgs_error_msg[MYSQL_ERRMSG_SIZE];
...@@ -1907,7 +1894,6 @@ typedef struct st_spider_result_list ...@@ -1907,7 +1894,6 @@ typedef struct st_spider_result_list
volatile longlong bgs_second_read; volatile longlong bgs_second_read;
volatile longlong bgs_split_read; volatile longlong bgs_split_read;
volatile volatile
#endif
SPIDER_RESULT *bgs_current; SPIDER_RESULT *bgs_current;
SPIDER_DB_ROW *tmp_pos_row_first; SPIDER_DB_ROW *tmp_pos_row_first;
} SPIDER_RESULT_LIST; } SPIDER_RESULT_LIST;
...@@ -1427,7 +1427,6 @@ void spider_udf_free_direct_sql_alloc( ...@@ -1427,7 +1427,6 @@ void spider_udf_free_direct_sql_alloc(
) { ) {
SPIDER_BG_DIRECT_SQL *bg_direct_sql; SPIDER_BG_DIRECT_SQL *bg_direct_sql;
DBUG_ENTER("spider_udf_free_direct_sql_alloc"); DBUG_ENTER("spider_udf_free_direct_sql_alloc");
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (bg) if (bg)
{ {
pthread_mutex_lock(direct_sql->bg_mutex); pthread_mutex_lock(direct_sql->bg_mutex);
...@@ -1441,7 +1440,6 @@ void spider_udf_free_direct_sql_alloc( ...@@ -1441,7 +1440,6 @@ void spider_udf_free_direct_sql_alloc(
pthread_cond_signal(direct_sql->bg_cond); pthread_cond_signal(direct_sql->bg_cond);
pthread_mutex_unlock(direct_sql->bg_mutex); pthread_mutex_unlock(direct_sql->bg_mutex);
} }
#endif
if (direct_sql->real_table_used && direct_sql->open_tables_thd) if (direct_sql->real_table_used && direct_sql->open_tables_thd)
{ {
spider_sys_close_table(direct_sql->open_tables_thd, spider_sys_close_table(direct_sql->open_tables_thd,
...@@ -1556,7 +1554,6 @@ long long spider_direct_sql_body( ...@@ -1556,7 +1554,6 @@ long long spider_direct_sql_body(
my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM); my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
goto error; goto error;
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (bg) if (bg)
{ {
bg_direct_sql = (SPIDER_BG_DIRECT_SQL *) initid->ptr; bg_direct_sql = (SPIDER_BG_DIRECT_SQL *) initid->ptr;
...@@ -1574,7 +1571,6 @@ long long spider_direct_sql_body( ...@@ -1574,7 +1571,6 @@ long long spider_direct_sql_body(
direct_sql->parent = bg_direct_sql; direct_sql->parent = bg_direct_sql;
bg_direct_sql->called_cnt++; bg_direct_sql->called_cnt++;
} }
#endif
if (!(trx = spider_get_trx(thd, TRUE, &error_num))) if (!(trx = spider_get_trx(thd, TRUE, &error_num)))
{ {
if (error_num == HA_ERR_OUT_OF_MEM) if (error_num == HA_ERR_OUT_OF_MEM)
...@@ -1723,7 +1719,6 @@ long long spider_direct_sql_body( ...@@ -1723,7 +1719,6 @@ long long spider_direct_sql_body(
direct_sql->sql_length = 0; direct_sql->sql_length = 0;
direct_sql->sql = sql; direct_sql->sql = sql;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (bg) if (bg)
{ {
if ((error_num = spider_udf_bg_direct_sql(direct_sql))) if ((error_num = spider_udf_bg_direct_sql(direct_sql)))
...@@ -1733,7 +1728,6 @@ long long spider_direct_sql_body( ...@@ -1733,7 +1728,6 @@ long long spider_direct_sql_body(
goto error; goto error;
} }
} else { } else {
#endif
if (conn->bg_init) if (conn->bg_init)
pthread_mutex_lock(&conn->bg_conn_mutex); pthread_mutex_lock(&conn->bg_conn_mutex);
if ((error_num = spider_db_udf_direct_sql(direct_sql))) if ((error_num = spider_db_udf_direct_sql(direct_sql)))
...@@ -1750,15 +1744,11 @@ long long spider_direct_sql_body( ...@@ -1750,15 +1744,11 @@ long long spider_direct_sql_body(
pthread_mutex_unlock(&conn->bg_conn_mutex); pthread_mutex_unlock(&conn->bg_conn_mutex);
if (direct_sql->modified_non_trans_table) if (direct_sql->modified_non_trans_table)
thd->transaction->stmt.modified_non_trans_table = TRUE; thd->transaction->stmt.modified_non_trans_table = TRUE;
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
if (!bg) if (!bg)
{ {
#endif
spider_udf_free_direct_sql_alloc(direct_sql, FALSE); spider_udf_free_direct_sql_alloc(direct_sql, FALSE);
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
DBUG_RETURN(1); DBUG_RETURN(1);
error: error:
...@@ -1799,7 +1789,6 @@ my_bool spider_direct_sql_init_body( ...@@ -1799,7 +1789,6 @@ my_bool spider_direct_sql_init_body(
strcpy(message, "spider_(bg)_direct_sql() requires string arguments"); strcpy(message, "spider_(bg)_direct_sql() requires string arguments");
goto error; goto error;
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (bg) if (bg)
{ {
if (!(bg_direct_sql = (SPIDER_BG_DIRECT_SQL *) if (!(bg_direct_sql = (SPIDER_BG_DIRECT_SQL *)
...@@ -1823,15 +1812,12 @@ my_bool spider_direct_sql_init_body( ...@@ -1823,15 +1812,12 @@ my_bool spider_direct_sql_init_body(
} }
initid->ptr = (char *) bg_direct_sql; initid->ptr = (char *) bg_direct_sql;
} }
#endif
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
#ifndef WITHOUT_SPIDER_BG_SEARCH
error_cond_init: error_cond_init:
pthread_mutex_destroy(&bg_direct_sql->bg_mutex); pthread_mutex_destroy(&bg_direct_sql->bg_mutex);
error_mutex_init: error_mutex_init:
spider_free(spider_current_trx, bg_direct_sql, MYF(0)); spider_free(spider_current_trx, bg_direct_sql, MYF(0));
#endif
error: error:
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -1859,7 +1845,6 @@ void spider_direct_sql_deinit_body( ...@@ -1859,7 +1845,6 @@ void spider_direct_sql_deinit_body(
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
void spider_direct_sql_bg_start( void spider_direct_sql_bg_start(
UDF_INIT *initid UDF_INIT *initid
) { ) {
...@@ -1948,4 +1933,3 @@ int spider_udf_bg_direct_sql( ...@@ -1948,4 +1933,3 @@ int spider_udf_bg_direct_sql(
} }
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#endif
...@@ -60,8 +60,6 @@ void spider_udf_free_direct_sql_alloc( ...@@ -60,8 +60,6 @@ void spider_udf_free_direct_sql_alloc(
my_bool bg my_bool bg
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_udf_bg_direct_sql( int spider_udf_bg_direct_sql(
SPIDER_DIRECT_SQL *direct_sql SPIDER_DIRECT_SQL *direct_sql
); );
#endif
...@@ -1257,9 +1257,7 @@ int spider_group_by_handler::init_scan() ...@@ -1257,9 +1257,7 @@ int spider_group_by_handler::init_scan()
) { ) {
result_list->internal_limit = select_limit /* + offset_limit */; result_list->internal_limit = select_limit /* + offset_limit */;
result_list->split_read = select_limit /* + offset_limit */; result_list->split_read = select_limit /* + offset_limit */;
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list->bgs_split_read = select_limit /* + offset_limit */; result_list->bgs_split_read = select_limit /* + offset_limit */;
#endif
result_list->split_read_base = 9223372036854775807LL; result_list->split_read_base = 9223372036854775807LL;
result_list->semi_split_read = 0; result_list->semi_split_read = 0;
...@@ -1270,10 +1268,8 @@ int spider_group_by_handler::init_scan() ...@@ -1270,10 +1268,8 @@ int spider_group_by_handler::init_scan()
} }
result_list->semi_split_read_base = 0; result_list->semi_split_read_base = 0;
result_list->set_split_read = TRUE; result_list->set_split_read = TRUE;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if ((error_num = spider_set_conn_bg_param(spider))) if ((error_num = spider_set_conn_bg_param(spider)))
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
#endif
DBUG_PRINT("info",("spider result_list.finish_flg = FALSE")); DBUG_PRINT("info",("spider result_list.finish_flg = FALSE"));
result_list->finish_flg = FALSE; result_list->finish_flg = FALSE;
result_list->record_num = 0; result_list->record_num = 0;
...@@ -1381,7 +1377,6 @@ int spider_group_by_handler::init_scan() ...@@ -1381,7 +1377,6 @@ int spider_group_by_handler::init_scan()
link_idx = link_idx_holder->link_idx; link_idx = link_idx_holder->link_idx;
dbton_hdl = spider->dbton_handler[conn->dbton_id]; dbton_hdl = spider->dbton_handler[conn->dbton_id];
spider->link_idx_chain = link_idx_chain; spider->link_idx_chain = link_idx_chain;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (result_list->bgs_phase > 0) if (result_list->bgs_phase > 0)
{ {
if ((error_num = spider_check_and_init_casual_read(trx->thd, spider, if ((error_num = spider_check_and_init_casual_read(trx->thd, spider,
...@@ -1405,7 +1400,6 @@ int spider_group_by_handler::init_scan() ...@@ -1405,7 +1400,6 @@ int spider_group_by_handler::init_scan()
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
} else { } else {
#endif
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
if (dbton_hdl->need_lock_before_set_sql_for_exec( if (dbton_hdl->need_lock_before_set_sql_for_exec(
SPIDER_SQL_TYPE_SELECT_SQL)) SPIDER_SQL_TYPE_SELECT_SQL))
...@@ -1511,9 +1505,7 @@ int spider_group_by_handler::init_scan() ...@@ -1511,9 +1505,7 @@ int spider_group_by_handler::init_scan()
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex); pthread_mutex_unlock(&conn->mta_conn_mutex);
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
} }
#endif
} }
first = TRUE; first = TRUE;
...@@ -1552,7 +1544,6 @@ int spider_group_by_handler::next_row() ...@@ -1552,7 +1544,6 @@ int spider_group_by_handler::next_row()
table->status = STATUS_NOT_FOUND; table->status = STATUS_NOT_FOUND;
DBUG_RETURN(spider->store_error_num); DBUG_RETURN(spider->store_error_num);
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (spider->result_list.bgs_phase > 0) if (spider->result_list.bgs_phase > 0)
{ {
fields->set_pos_to_first_link_idx_chain(); fields->set_pos_to_first_link_idx_chain();
...@@ -1581,7 +1572,6 @@ int spider_group_by_handler::next_row() ...@@ -1581,7 +1572,6 @@ int spider_group_by_handler::next_row()
} }
} }
} }
#endif
spider->use_pre_call = FALSE; spider->use_pre_call = FALSE;
} }
} else if (offset_limit) } else if (offset_limit)
......
...@@ -198,7 +198,6 @@ typedef struct st_spider_share SPIDER_SHARE; ...@@ -198,7 +198,6 @@ typedef struct st_spider_share SPIDER_SHARE;
typedef struct st_spider_table_mon_list SPIDER_TABLE_MON_LIST; typedef struct st_spider_table_mon_list SPIDER_TABLE_MON_LIST;
typedef struct st_spider_ip_port_conn SPIDER_IP_PORT_CONN; typedef struct st_spider_ip_port_conn SPIDER_IP_PORT_CONN;
#ifndef WITHOUT_SPIDER_BG_SEARCH
typedef struct st_spider_thread typedef struct st_spider_thread
{ {
uint thread_idx; uint thread_idx;
...@@ -215,7 +214,6 @@ typedef struct st_spider_thread ...@@ -215,7 +214,6 @@ typedef struct st_spider_thread
volatile SPIDER_SHARE *queue_first; volatile SPIDER_SHARE *queue_first;
volatile SPIDER_SHARE *queue_last; volatile SPIDER_SHARE *queue_last;
} SPIDER_THREAD; } SPIDER_THREAD;
#endif
typedef struct st_spider_file_pos typedef struct st_spider_file_pos
{ {
...@@ -434,11 +432,8 @@ typedef struct st_spider_conn ...@@ -434,11 +432,8 @@ typedef struct st_spider_conn
uint tgt_driver_length; uint tgt_driver_length;
uint dbton_id; uint dbton_id;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
void *quick_target; void *quick_target;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile bool bg_init; volatile bool bg_init;
volatile bool bg_break; volatile bool bg_break;
volatile bool bg_kill; volatile bool bg_kill;
...@@ -469,10 +464,7 @@ typedef struct st_spider_conn ...@@ -469,10 +464,7 @@ typedef struct st_spider_conn
const char *bg_job_stack_file_name; const char *bg_job_stack_file_name;
ulong bg_job_stack_line_no; ulong bg_job_stack_line_no;
uint bg_job_stack_cur_pos; uint bg_job_stack_cur_pos;
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile volatile
#endif
int *need_mon; int *need_mon;
int *conn_need_mon; int *conn_need_mon;
...@@ -781,7 +773,6 @@ typedef struct st_spider_share ...@@ -781,7 +773,6 @@ typedef struct st_spider_share
uchar *table_mon_mutex_bitmap; uchar *table_mon_mutex_bitmap;
volatile bool sts_init; volatile bool sts_init;
volatile time_t sts_get_time; volatile time_t sts_get_time;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile time_t bg_sts_try_time; volatile time_t bg_sts_try_time;
volatile double bg_sts_interval; volatile double bg_sts_interval;
volatile int bg_sts_mode; volatile int bg_sts_mode;
...@@ -796,9 +787,7 @@ typedef struct st_spider_share ...@@ -796,9 +787,7 @@ typedef struct st_spider_share
pthread_cond_t bg_sts_cond; pthread_cond_t bg_sts_cond;
pthread_cond_t bg_sts_sync_cond; pthread_cond_t bg_sts_sync_cond;
volatile bool crd_init; volatile bool crd_init;
#endif
volatile time_t crd_get_time; volatile time_t crd_get_time;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile time_t bg_crd_try_time; volatile time_t bg_crd_try_time;
volatile double bg_crd_interval; volatile double bg_crd_interval;
volatile int bg_crd_mode; volatile int bg_crd_mode;
...@@ -812,8 +801,6 @@ typedef struct st_spider_share ...@@ -812,8 +801,6 @@ typedef struct st_spider_share
pthread_t bg_crd_thread; pthread_t bg_crd_thread;
pthread_cond_t bg_crd_cond; pthread_cond_t bg_crd_cond;
pthread_cond_t bg_crd_sync_cond; pthread_cond_t bg_crd_sync_cond;
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile bool bg_mon_init; volatile bool bg_mon_init;
volatile bool bg_mon_kill; volatile bool bg_mon_kill;
THD **bg_mon_thds; THD **bg_mon_thds;
...@@ -821,8 +808,6 @@ typedef struct st_spider_share ...@@ -821,8 +808,6 @@ typedef struct st_spider_share
pthread_mutex_t *bg_mon_mutexes; pthread_mutex_t *bg_mon_mutexes;
pthread_cond_t *bg_mon_conds; pthread_cond_t *bg_mon_conds;
pthread_cond_t *bg_mon_sleep_conds; pthread_cond_t *bg_mon_sleep_conds;
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* static bg thread for sts and crd */ /* static bg thread for sts and crd */
TABLE table; TABLE table;
ha_spider *sts_spider; ha_spider *sts_spider;
...@@ -839,7 +824,6 @@ typedef struct st_spider_share ...@@ -839,7 +824,6 @@ typedef struct st_spider_share
volatile SPIDER_SHARE *sts_next; volatile SPIDER_SHARE *sts_next;
volatile SPIDER_SHARE *crd_prev; volatile SPIDER_SHARE *crd_prev;
volatile SPIDER_SHARE *crd_next; volatile SPIDER_SHARE *crd_next;
#endif
MEM_ROOT mem_root; MEM_ROOT mem_root;
...@@ -861,9 +845,7 @@ typedef struct st_spider_share ...@@ -861,9 +845,7 @@ typedef struct st_spider_share
longlong additional_table_flags; longlong additional_table_flags;
bool have_recovery_link; bool have_recovery_link;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int sts_bg_mode; int sts_bg_mode;
#endif
double sts_interval; double sts_interval;
int sts_mode; int sts_mode;
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
...@@ -871,9 +853,7 @@ typedef struct st_spider_share ...@@ -871,9 +853,7 @@ typedef struct st_spider_share
#endif #endif
int store_last_sts; int store_last_sts;
int load_sts_at_startup; int load_sts_at_startup;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int crd_bg_mode; int crd_bg_mode;
#endif
double crd_interval; double crd_interval;
int crd_mode; int crd_mode;
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
...@@ -913,11 +893,9 @@ typedef struct st_spider_share ...@@ -913,11 +893,9 @@ typedef struct st_spider_share
int low_mem_read; int low_mem_read;
int table_count_mode; int table_count_mode;
int select_column_mode; int select_column_mode;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int bgs_mode; int bgs_mode;
longlong bgs_first_read; longlong bgs_first_read;
longlong bgs_second_read; longlong bgs_second_read;
#endif
longlong first_read; longlong first_read;
longlong second_read; longlong second_read;
int auto_increment_mode; int auto_increment_mode;
...@@ -975,16 +953,12 @@ typedef struct st_spider_share ...@@ -975,16 +953,12 @@ typedef struct st_spider_share
long *tgt_ports; long *tgt_ports;
long *tgt_ssl_vscs; long *tgt_ssl_vscs;
long *link_statuses; long *link_statuses;
#ifndef WITHOUT_SPIDER_BG_SEARCH
long *monitoring_bg_flag; long *monitoring_bg_flag;
long *monitoring_bg_kind; long *monitoring_bg_kind;
#endif
long *monitoring_binlog_pos_at_failing; long *monitoring_binlog_pos_at_failing;
long *monitoring_flag; long *monitoring_flag;
long *monitoring_kind; long *monitoring_kind;
#ifndef WITHOUT_SPIDER_BG_SEARCH
longlong *monitoring_bg_interval; longlong *monitoring_bg_interval;
#endif
longlong *monitoring_limit; longlong *monitoring_limit;
longlong *monitoring_sid; longlong *monitoring_sid;
long *use_handlers; long *use_handlers;
...@@ -1067,16 +1041,12 @@ typedef struct st_spider_share ...@@ -1067,16 +1041,12 @@ typedef struct st_spider_share
uint tgt_ports_length; uint tgt_ports_length;
uint tgt_ssl_vscs_length; uint tgt_ssl_vscs_length;
uint link_statuses_length; uint link_statuses_length;
#ifndef WITHOUT_SPIDER_BG_SEARCH
uint monitoring_bg_flag_length; uint monitoring_bg_flag_length;
uint monitoring_bg_kind_length; uint monitoring_bg_kind_length;
#endif
uint monitoring_binlog_pos_at_failing_length; uint monitoring_binlog_pos_at_failing_length;
uint monitoring_flag_length; uint monitoring_flag_length;
uint monitoring_kind_length; uint monitoring_kind_length;
#ifndef WITHOUT_SPIDER_BG_SEARCH
uint monitoring_bg_interval_length; uint monitoring_bg_interval_length;
#endif
uint monitoring_limit_length; uint monitoring_limit_length;
uint monitoring_sid_length; uint monitoring_sid_length;
uint use_handlers_length; uint use_handlers_length;
...@@ -1270,9 +1240,7 @@ typedef struct st_spider_copy_table_conn ...@@ -1270,9 +1240,7 @@ typedef struct st_spider_copy_table_conn
spider_db_copy_table *copy_table; spider_db_copy_table *copy_table;
ha_spider *spider; ha_spider *spider;
int need_mon; int need_mon;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int bg_error_num; int bg_error_num;
#endif
st_spider_copy_table_conn *next; st_spider_copy_table_conn *next;
} SPIDER_COPY_TABLE_CONN; } SPIDER_COPY_TABLE_CONN;
...@@ -1297,9 +1265,7 @@ typedef struct st_spider_copy_tables ...@@ -1297,9 +1265,7 @@ typedef struct st_spider_copy_tables
longlong bulk_insert_rows; longlong bulk_insert_rows;
int use_table_charset; int use_table_charset;
int use_transaction; int use_transaction;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int bg_mode; int bg_mode;
#endif
char *database; char *database;
......
...@@ -1400,7 +1400,6 @@ int spider_param_select_column_mode( ...@@ -1400,7 +1400,6 @@ int spider_param_select_column_mode(
select_column_mode : THDVAR(thd, select_column_mode)); select_column_mode : THDVAR(thd, select_column_mode));
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* /*
-1 :use table parameter -1 :use table parameter
0 :background search is disabled 0 :background search is disabled
...@@ -1480,7 +1479,6 @@ longlong spider_param_bgs_second_read( ...@@ -1480,7 +1479,6 @@ longlong spider_param_bgs_second_read(
DBUG_RETURN(THDVAR(thd, bgs_second_read) < 0 ? DBUG_RETURN(THDVAR(thd, bgs_second_read) < 0 ?
bgs_second_read : THDVAR(thd, bgs_second_read)); bgs_second_read : THDVAR(thd, bgs_second_read));
} }
#endif
/* /*
-1 :use table parameter -1 :use table parameter
...@@ -1670,7 +1668,6 @@ double spider_param_crd_weight( ...@@ -1670,7 +1668,6 @@ double spider_param_crd_weight(
crd_weight : THDVAR(thd, crd_weight)); crd_weight : THDVAR(thd, crd_weight));
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* /*
-1 :use table parameter -1 :use table parameter
0 :Background confirmation is disabled 0 :Background confirmation is disabled
...@@ -1697,7 +1694,6 @@ int spider_param_crd_bg_mode( ...@@ -1697,7 +1694,6 @@ int spider_param_crd_bg_mode(
DBUG_RETURN(THDVAR(thd, crd_bg_mode) == -1 ? DBUG_RETURN(THDVAR(thd, crd_bg_mode) == -1 ?
crd_bg_mode : THDVAR(thd, crd_bg_mode)); crd_bg_mode : THDVAR(thd, crd_bg_mode));
} }
#endif
/* /*
-1 :use table parameter -1 :use table parameter
...@@ -1782,7 +1778,6 @@ int spider_param_sts_sync( ...@@ -1782,7 +1778,6 @@ int spider_param_sts_sync(
} }
#endif #endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* /*
-1 :use table parameter -1 :use table parameter
0 :Background confirmation is disabled 0 :Background confirmation is disabled
...@@ -1809,7 +1804,6 @@ int spider_param_sts_bg_mode( ...@@ -1809,7 +1804,6 @@ int spider_param_sts_bg_mode(
DBUG_RETURN(THDVAR(thd, sts_bg_mode) == -1 ? DBUG_RETURN(THDVAR(thd, sts_bg_mode) == -1 ?
sts_bg_mode : THDVAR(thd, sts_bg_mode)); sts_bg_mode : THDVAR(thd, sts_bg_mode));
} }
#endif
/* /*
0 :always ping 0 :always ping
...@@ -2966,7 +2960,6 @@ int spider_param_load_crd_at_startup( ...@@ -2966,7 +2960,6 @@ int spider_param_load_crd_at_startup(
load_crd_at_startup : spider_load_crd_at_startup); load_crd_at_startup : spider_load_crd_at_startup);
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
static uint spider_table_sts_thread_count; static uint spider_table_sts_thread_count;
/* /*
1-: thread count 1-: thread count
...@@ -3012,7 +3005,6 @@ uint spider_param_table_crd_thread_count() ...@@ -3012,7 +3005,6 @@ uint spider_param_table_crd_thread_count()
DBUG_ENTER("spider_param_table_crd_thread_count"); DBUG_ENTER("spider_param_table_crd_thread_count");
DBUG_RETURN(spider_table_crd_thread_count); DBUG_RETURN(spider_table_crd_thread_count);
} }
#endif
static int spider_slave_trx_isolation; static int spider_slave_trx_isolation;
/* /*
...@@ -3189,11 +3181,9 @@ static struct st_mysql_sys_var* spider_system_variables[] = { ...@@ -3189,11 +3181,9 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(quick_page_byte), MYSQL_SYSVAR(quick_page_byte),
MYSQL_SYSVAR(low_mem_read), MYSQL_SYSVAR(low_mem_read),
MYSQL_SYSVAR(select_column_mode), MYSQL_SYSVAR(select_column_mode),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR(bgs_mode), MYSQL_SYSVAR(bgs_mode),
MYSQL_SYSVAR(bgs_first_read), MYSQL_SYSVAR(bgs_first_read),
MYSQL_SYSVAR(bgs_second_read), MYSQL_SYSVAR(bgs_second_read),
#endif
MYSQL_SYSVAR(first_read), MYSQL_SYSVAR(first_read),
MYSQL_SYSVAR(second_read), MYSQL_SYSVAR(second_read),
MYSQL_SYSVAR(crd_interval), MYSQL_SYSVAR(crd_interval),
...@@ -3205,9 +3195,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = { ...@@ -3205,9 +3195,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(load_crd_at_startup), MYSQL_SYSVAR(load_crd_at_startup),
MYSQL_SYSVAR(crd_type), MYSQL_SYSVAR(crd_type),
MYSQL_SYSVAR(crd_weight), MYSQL_SYSVAR(crd_weight),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR(crd_bg_mode), MYSQL_SYSVAR(crd_bg_mode),
#endif
MYSQL_SYSVAR(sts_interval), MYSQL_SYSVAR(sts_interval),
MYSQL_SYSVAR(sts_mode), MYSQL_SYSVAR(sts_mode),
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
...@@ -3215,9 +3203,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = { ...@@ -3215,9 +3203,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
#endif #endif
MYSQL_SYSVAR(store_last_sts), MYSQL_SYSVAR(store_last_sts),
MYSQL_SYSVAR(load_sts_at_startup), MYSQL_SYSVAR(load_sts_at_startup),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR(sts_bg_mode), MYSQL_SYSVAR(sts_bg_mode),
#endif
MYSQL_SYSVAR(ping_interval_at_trx_start), MYSQL_SYSVAR(ping_interval_at_trx_start),
MYSQL_SYSVAR(auto_increment_mode), MYSQL_SYSVAR(auto_increment_mode),
MYSQL_SYSVAR(same_server_link), MYSQL_SYSVAR(same_server_link),
...@@ -3266,10 +3252,8 @@ static struct st_mysql_sys_var* spider_system_variables[] = { ...@@ -3266,10 +3252,8 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(bka_table_name_type), MYSQL_SYSVAR(bka_table_name_type),
MYSQL_SYSVAR(use_cond_other_than_pk_for_update), MYSQL_SYSVAR(use_cond_other_than_pk_for_update),
MYSQL_SYSVAR(connect_error_interval), MYSQL_SYSVAR(connect_error_interval),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR(table_sts_thread_count), MYSQL_SYSVAR(table_sts_thread_count),
MYSQL_SYSVAR(table_crd_thread_count), MYSQL_SYSVAR(table_crd_thread_count),
#endif
MYSQL_SYSVAR(slave_trx_isolation), MYSQL_SYSVAR(slave_trx_isolation),
MYSQL_SYSVAR(remote_wait_timeout), MYSQL_SYSVAR(remote_wait_timeout),
MYSQL_SYSVAR(wait_timeout), MYSQL_SYSVAR(wait_timeout),
......
...@@ -182,7 +182,6 @@ int spider_param_select_column_mode( ...@@ -182,7 +182,6 @@ int spider_param_select_column_mode(
THD *thd, THD *thd,
int select_column_mode int select_column_mode
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_param_bgs_mode( int spider_param_bgs_mode(
THD *thd, THD *thd,
int bgs_mode int bgs_mode
...@@ -195,7 +194,6 @@ longlong spider_param_bgs_second_read( ...@@ -195,7 +194,6 @@ longlong spider_param_bgs_second_read(
THD *thd, THD *thd,
longlong bgs_second_read longlong bgs_second_read
); );
#endif
longlong spider_param_first_read( longlong spider_param_first_read(
THD *thd, THD *thd,
longlong first_read longlong first_read
...@@ -226,12 +224,10 @@ double spider_param_crd_weight( ...@@ -226,12 +224,10 @@ double spider_param_crd_weight(
THD *thd, THD *thd,
double crd_weight double crd_weight
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_param_crd_bg_mode( int spider_param_crd_bg_mode(
THD *thd, THD *thd,
int crd_bg_mode int crd_bg_mode
); );
#endif
double spider_param_sts_interval( double spider_param_sts_interval(
THD *thd, THD *thd,
double sts_interval double sts_interval
...@@ -246,12 +242,10 @@ int spider_param_sts_sync( ...@@ -246,12 +242,10 @@ int spider_param_sts_sync(
int sts_sync int sts_sync
); );
#endif #endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_param_sts_bg_mode( int spider_param_sts_bg_mode(
THD *thd, THD *thd,
int sts_bg_mode int sts_bg_mode
); );
#endif
double spider_param_ping_interval_at_trx_start( double spider_param_ping_interval_at_trx_start(
THD *thd THD *thd
); );
...@@ -386,10 +380,8 @@ int spider_param_load_sts_at_startup( ...@@ -386,10 +380,8 @@ int spider_param_load_sts_at_startup(
int spider_param_load_crd_at_startup( int spider_param_load_crd_at_startup(
int load_crd_at_startup int load_crd_at_startup
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
uint spider_param_table_sts_thread_count(); uint spider_param_table_sts_thread_count();
uint spider_param_table_crd_thread_count(); uint spider_param_table_crd_thread_count();
#endif
int spider_param_slave_trx_isolation(); int spider_param_slave_trx_isolation();
int spider_param_remote_wait_timeout( int spider_param_remote_wait_timeout(
THD *thd THD *thd
......
This diff is collapsed.
...@@ -759,7 +759,6 @@ int spider_discover_table_structure( ...@@ -759,7 +759,6 @@ int spider_discover_table_structure(
); );
#endif #endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
int spider_create_spider_object_for_share( int spider_create_spider_object_for_share(
SPIDER_TRX *trx, SPIDER_TRX *trx,
SPIDER_SHARE *share, SPIDER_SHARE *share,
...@@ -809,7 +808,6 @@ void spider_table_remove_share_from_sts_thread( ...@@ -809,7 +808,6 @@ void spider_table_remove_share_from_sts_thread(
void spider_table_remove_share_from_crd_thread( void spider_table_remove_share_from_crd_thread(
SPIDER_SHARE *share SPIDER_SHARE *share
); );
#endif
uchar *spider_duplicate_char( uchar *spider_duplicate_char(
uchar *dst, uchar *dst,
uchar esc, uchar esc,
......
...@@ -43,7 +43,6 @@ void spider_direct_sql_deinit( ...@@ -43,7 +43,6 @@ void spider_direct_sql_deinit(
spider_direct_sql_deinit_body(initid); spider_direct_sql_deinit_body(initid);
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
long long spider_bg_direct_sql( long long spider_bg_direct_sql(
UDF_INIT *initid, UDF_INIT *initid,
UDF_ARGS *args, UDF_ARGS *args,
...@@ -83,7 +82,6 @@ void spider_bg_direct_sql_add( ...@@ -83,7 +82,6 @@ void spider_bg_direct_sql_add(
) { ) {
spider_direct_sql_body(initid, args, is_null, error, TRUE); spider_direct_sql_body(initid, args, is_null, error, TRUE);
} }
#endif
long long spider_ping_table( long long spider_ping_table(
UDF_INIT *initid, UDF_INIT *initid,
......
...@@ -32,7 +32,6 @@ void spider_direct_sql_deinit_body( ...@@ -32,7 +32,6 @@ void spider_direct_sql_deinit_body(
UDF_INIT *initid UDF_INIT *initid
); );
#ifndef WITHOUT_SPIDER_BG_SEARCH
void spider_direct_sql_bg_start( void spider_direct_sql_bg_start(
UDF_INIT *initid UDF_INIT *initid
); );
...@@ -40,7 +39,6 @@ void spider_direct_sql_bg_start( ...@@ -40,7 +39,6 @@ void spider_direct_sql_bg_start(
long long spider_direct_sql_bg_end( long long spider_direct_sql_bg_end(
UDF_INIT *initid UDF_INIT *initid
); );
#endif
long long spider_ping_table_body( long long spider_ping_table_body(
UDF_INIT *initid, UDF_INIT *initid,
......
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