Commit f76da7f6 authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

MDEV-27474 Spider: remove #WITH_PARTITION_STORAGE_ENGINE

"#ifdef WITH_PARTITION_STORAGE_ENGINE ... #endif" appears frequently
in the Spider code base. However, there is no need to maintain such
ifdefs because Spider is disabled if the partitioning engine is disabled.
parent 3eb1e11d
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_HANDLERSOCKET")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_HANDLERSOCKET")
IF(HAVE_WVLA)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wno-vla")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wno-vla")
......@@ -20,25 +17,9 @@ SET(SPIDER_SOURCES
spd_db_mysql.cc spd_group_by_handler.cc spd_db_include.cc
)
IF(EXISTS ${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake)
SET(CMAKE_CXX_FLAGS_DEBUG
"${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
SET(CMAKE_C_FLAGS_DEBUG
"${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex)
MYSQL_STORAGE_ENGINE(SPIDER)
ELSEIF(PLUGIN_PARTITION MATCHES "^NO$")
IF(PLUGIN_PARTITION MATCHES "^NO$")
MESSAGE(STATUS "Spider is skipped because partitioning is disabled")
ELSE()
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/spider/hs_client)
IF(DEB)
SET(extra_options COMPONENT spider-engine)
ELSE()
......
This diff is collapsed.
......@@ -79,9 +79,7 @@ class ha_spider final : public handler
spider_string *blob_buff;
SPIDER_POSITION *pushed_pos;
SPIDER_POSITION pushed_pos_buf;
#ifdef WITH_PARTITION_STORAGE_ENGINE
SPIDER_PARTITION_HANDLER *partition_handler;
#endif
bool wide_handler_owner = FALSE;
SPIDER_WIDE_HANDLER *wide_handler = NULL;
......@@ -544,9 +542,7 @@ class ha_spider final : public handler
void set_clone_searched_bitmap();
void set_searched_bitmap_from_item_list();
void set_select_column_mode();
#ifdef WITH_PARTITION_STORAGE_ENGINE
void check_select_column(bool rnd);
#endif
bool check_and_start_bulk_update(
spider_bulk_upd_start bulk_upd_start
);
......
......@@ -3075,18 +3075,11 @@ void *spider_bg_sts_action(
}
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (spider_get_sts(share, spider.search_link_idx,
share->bg_sts_try_time, &spider,
share->bg_sts_interval, share->bg_sts_mode,
share->bg_sts_sync,
2, HA_STATUS_CONST | HA_STATUS_VARIABLE))
#else
if (spider_get_sts(share, spider.search_link_idx,
share->bg_sts_try_time, &spider,
share->bg_sts_interval, share->bg_sts_mode,
2, HA_STATUS_CONST | HA_STATUS_VARIABLE))
#endif
{
/*
if (
......@@ -3407,18 +3400,11 @@ void *spider_bg_crd_action(
}
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (spider_get_crd(share, spider.search_link_idx,
share->bg_crd_try_time, &spider, &table,
share->bg_crd_interval, share->bg_crd_mode,
share->bg_crd_sync,
2))
#else
if (spider_get_crd(share, spider.search_link_idx,
share->bg_crd_try_time, &spider, &table,
share->bg_crd_interval, share->bg_crd_mode,
2))
#endif
{
/*
if (
......
......@@ -409,10 +409,8 @@ int spider_udf_get_copy_tgt_tables(
if (
(error_num = spider_set_connect_info_default(
tmp_share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
NULL,
NULL,
#endif
NULL
)) ||
(error_num = spider_set_connect_info_default_db_table(
......
......@@ -1628,7 +1628,6 @@ group_by_handler *spider_create_group_by_handler(
break;
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
from = query->from;
do {
DBUG_PRINT("info",("spider from=%p", from));
......@@ -1647,7 +1646,6 @@ group_by_handler *spider_create_group_by_handler(
}
}
} while ((from = from->next_local));
#endif
table_idx = 0;
from = query->from;
......
......@@ -527,7 +527,6 @@ typedef struct st_spider_lgtm_tblhnd_share
ulonglong auto_increment_value;
} SPIDER_LGTM_TBLHND_SHARE;
#ifdef WITH_PARTITION_STORAGE_ENGINE
typedef struct st_spider_patition_handler
{
bool clone_bitmap_init;
......@@ -537,7 +536,6 @@ typedef struct st_spider_patition_handler
ha_spider *owner;
ha_spider **handlers;
} SPIDER_PARTITION_HANDLER;
#endif
typedef struct st_spider_wide_share
{
......@@ -586,9 +584,7 @@ typedef struct st_spider_wide_handler
uchar *rnd_write_bitmap;
SPIDER_CONDITION *condition;
void *owner;
#ifdef WITH_PARTITION_STORAGE_ENGINE
SPIDER_PARTITION_HANDLER *partition_handler;
#endif
List<Item> *direct_update_fields;
List<Item> *direct_update_values;
TABLE_SHARE *top_share;
......@@ -723,9 +719,7 @@ typedef struct st_spider_share
TABLE_SHARE *table_share;
SPIDER_LGTM_TBLHND_SHARE *lgtm_tblhnd_share;
my_hash_value_type table_name_hash_value;
#ifdef WITH_PARTITION_STORAGE_ENGINE
my_hash_value_type table_path_hash_value;
#endif
volatile bool init;
volatile bool init_error;
......@@ -737,9 +731,7 @@ typedef struct st_spider_share
volatile time_t bg_sts_try_time;
volatile double bg_sts_interval;
volatile int bg_sts_mode;
#ifdef WITH_PARTITION_STORAGE_ENGINE
volatile int bg_sts_sync;
#endif
volatile bool bg_sts_init;
volatile bool bg_sts_kill;
volatile bool bg_sts_thd_wait;
......@@ -752,9 +744,7 @@ typedef struct st_spider_share
volatile time_t bg_crd_try_time;
volatile double bg_crd_interval;
volatile int bg_crd_mode;
#ifdef WITH_PARTITION_STORAGE_ENGINE
volatile int bg_crd_sync;
#endif
volatile bool bg_crd_init;
volatile bool bg_crd_kill;
volatile bool bg_crd_thd_wait;
......@@ -809,17 +799,13 @@ typedef struct st_spider_share
int sts_bg_mode;
double sts_interval;
int sts_mode;
#ifdef WITH_PARTITION_STORAGE_ENGINE
int sts_sync;
#endif
int store_last_sts;
int load_sts_at_startup;
int crd_bg_mode;
double crd_interval;
int crd_mode;
#ifdef WITH_PARTITION_STORAGE_ENGINE
int crd_sync;
#endif
int store_last_crd;
int load_crd_at_startup;
int crd_type;
......
......@@ -1594,7 +1594,6 @@ int spider_param_crd_mode(
crd_mode : THDVAR(thd, crd_mode));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
-1 :use table parameter
0 :No synchronization.
......@@ -1622,7 +1621,6 @@ int spider_param_crd_sync(
DBUG_RETURN(THDVAR(thd, crd_sync) == -1 ?
crd_sync : THDVAR(thd, crd_sync));
}
#endif
/*
-1 :use table parameter
......@@ -1756,7 +1754,6 @@ int spider_param_sts_mode(
sts_mode : THDVAR(thd, sts_mode));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
-1 :use table parameter
0 :No synchronization.
......@@ -1784,7 +1781,6 @@ int spider_param_sts_sync(
DBUG_RETURN(THDVAR(thd, sts_sync) == -1 ?
sts_sync : THDVAR(thd, sts_sync));
}
#endif
/*
-1 :use table parameter
......@@ -3168,9 +3164,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(second_read),
MYSQL_SYSVAR(crd_interval),
MYSQL_SYSVAR(crd_mode),
#ifdef WITH_PARTITION_STORAGE_ENGINE
MYSQL_SYSVAR(crd_sync),
#endif
MYSQL_SYSVAR(store_last_crd),
MYSQL_SYSVAR(load_crd_at_startup),
MYSQL_SYSVAR(crd_type),
......@@ -3178,9 +3172,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(crd_bg_mode),
MYSQL_SYSVAR(sts_interval),
MYSQL_SYSVAR(sts_mode),
#ifdef WITH_PARTITION_STORAGE_ENGINE
MYSQL_SYSVAR(sts_sync),
#endif
MYSQL_SYSVAR(store_last_sts),
MYSQL_SYSVAR(load_sts_at_startup),
MYSQL_SYSVAR(sts_bg_mode),
......
......@@ -210,12 +210,10 @@ int spider_param_crd_mode(
THD *thd,
int crd_mode
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
int spider_param_crd_sync(
THD *thd,
int crd_sync
);
#endif
int spider_param_crd_type(
THD *thd,
int crd_type
......@@ -236,12 +234,10 @@ int spider_param_sts_mode(
THD *thd,
int sts_mode
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
int spider_param_sts_sync(
THD *thd,
int sts_sync
);
#endif
int spider_param_sts_bg_mode(
THD *thd,
int sts_bg_mode
......
......@@ -365,10 +365,8 @@ int spider_get_ping_table_mon(
if (
(error_num = spider_set_connect_info_default(
tmp_share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
NULL,
NULL,
#endif
NULL
)) ||
(error_num = spider_set_connect_info_default_dbtable(
......@@ -521,10 +519,8 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
if (
(*error_num = spider_set_connect_info_default(
tmp_share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
NULL,
NULL,
#endif
NULL
)) ||
(*error_num = spider_set_connect_info_default_dbtable(
......
This diff is collapsed.
......@@ -402,18 +402,14 @@ int spider_increase_longlong_list(
int spider_parse_connect_info(
SPIDER_SHARE *share,
TABLE_SHARE *table_share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info,
#endif
uint create_table
);
int spider_set_connect_info_default(
SPIDER_SHARE *share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_element *part_elem,
partition_element *sub_elem,
#endif
TABLE_SHARE *table_share
);
......@@ -459,9 +455,7 @@ void spider_free_lgtm_tblhnd_share_alloc(
SPIDER_SHARE *spider_create_share(
const char *table_name,
TABLE_SHARE *table_share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info,
#endif
my_hash_value_type hash_value,
int *error_num
);
......@@ -572,7 +566,6 @@ char *spider_create_table_name_string(
const char *sub_name
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
void spider_get_partition_info(
const char *table_name,
uint table_name_length,
......@@ -581,7 +574,6 @@ void spider_get_partition_info(
partition_element **part_elem,
partition_element **sub_elem
);
#endif
int spider_get_sts(
SPIDER_SHARE *share,
......@@ -590,9 +582,7 @@ int spider_get_sts(
ha_spider *spider,
double sts_interval,
int sts_mode,
#ifdef WITH_PARTITION_STORAGE_ENGINE
int sts_sync,
#endif
int sts_sync_level,
uint flag
);
......@@ -605,9 +595,7 @@ int spider_get_crd(
TABLE *table,
double crd_interval,
int crd_mode,
#ifdef WITH_PARTITION_STORAGE_ENGINE
int crd_sync,
#endif
int crd_sync_level
);
......
......@@ -1265,10 +1265,8 @@ SPIDER_TRX *spider_get_trx(
if (
spider_set_connect_info_default(
trx->tmp_share,
#ifdef WITH_PARTITION_STORAGE_ENGINE
NULL,
NULL,
#endif
NULL
) ||
spider_set_connect_info_default_db_table(
......
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