Commit f12e92db authored by Kentoku SHIBA's avatar Kentoku SHIBA

Fix for parallel search. #1129074

parent 49a4bbe1
......@@ -6748,10 +6748,6 @@ int ha_spider::rnd_init(
memset(searched_bitmap, 0xFF, no_bytes_in_map(table->read_set));
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if ((error_num = spider_set_conn_bg_param(this)))
DBUG_RETURN(error_num);
#endif
set_select_column_mode();
result_list.keyread = FALSE;
......@@ -6830,6 +6826,10 @@ int ha_spider::rnd_next_internal(
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (sql_kinds & SPIDER_SQL_KIND_HS)
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
if ((error_num = spider_set_conn_bg_param(this)))
DBUG_RETURN(error_num);
#endif
if ((error_num = rnd_handler_init()))
DBUG_RETURN(check_error_mode_eof(error_num));
......
......@@ -1467,11 +1467,23 @@ int spider_set_conn_bg_param(
else {
result_list->bgs_phase = 1;
result_list->bgs_first_read =
spider_param_bgs_first_read(thd, share->bgs_first_read);
result_list->bgs_second_read =
spider_param_bgs_second_read(thd, share->bgs_second_read);
result_list->bgs_split_read = spider_bg_split_read_param(spider);
if (spider->use_pre_call)
{
DBUG_PRINT("info",("spider use_pre_call=TRUE"));
result_list->bgs_first_read = result_list->bgs_split_read;
result_list->bgs_second_read = result_list->bgs_split_read;
} else {
DBUG_PRINT("info",("spider use_pre_call=FALSE"));
result_list->bgs_first_read =
spider_param_bgs_first_read(thd, share->bgs_first_read);
result_list->bgs_second_read =
spider_param_bgs_second_read(thd, share->bgs_second_read);
}
DBUG_PRINT("info",("spider bgs_split_read=%lld",
result_list->bgs_split_read));
DBUG_PRINT("info",("spider bgs_first_read=%lld", share->bgs_first_read));
DBUG_PRINT("info",("spider bgs_second_read=%lld", share->bgs_second_read));
result_list->split_read =
result_list->bgs_first_read > 0 ?
......
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