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