1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-27643 Spider: remove #ifdef HA_CAN_BULK_ACCESS

This commit is contained in:
Yuchen Pei
2024-06-18 10:21:38 +08:00
parent e7570c7759
commit f5b7c25e1e
14 changed files with 0 additions and 1797 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -88,21 +88,6 @@ public:
bool wide_handler_owner = FALSE; bool wide_handler_owner = FALSE;
SPIDER_WIDE_HANDLER *wide_handler = NULL; SPIDER_WIDE_HANDLER *wide_handler = NULL;
#ifdef HA_CAN_BULK_ACCESS
int pre_direct_init_result;
bool is_bulk_access_clone;
bool synced_from_clone_source;
bool bulk_access_started;
bool bulk_access_executing;
bool bulk_access_pre_called;
SPIDER_BULK_ACCESS_LINK *bulk_access_link_first;
SPIDER_BULK_ACCESS_LINK *bulk_access_link_current;
SPIDER_BULK_ACCESS_LINK *bulk_access_link_exec_tgt;
/*
bool init_ha_mem_root;
MEM_ROOT ha_mem_root;
*/
#endif
bool is_clone; bool is_clone;
ha_spider *pt_clone_source_handler; ha_spider *pt_clone_source_handler;
ha_spider *pt_clone_last_searcher; ha_spider *pt_clone_last_searcher;
@@ -221,12 +206,6 @@ public:
void check_access_kind( void check_access_kind(
THD *thd THD *thd
); );
#ifdef HA_CAN_BULK_ACCESS
int additional_lock(
THD *thd,
enum thr_lock_type lock_type
);
#endif
THR_LOCK_DATA **store_lock( THR_LOCK_DATA **store_lock(
THD *thd, THD *thd,
THR_LOCK_DATA **to, THR_LOCK_DATA **to,
@@ -248,16 +227,7 @@ public:
uint idx, uint idx,
bool sorted bool sorted
) override; ) override;
#ifdef HA_CAN_BULK_ACCESS
int pre_index_init(
uint idx,
bool sorted
);
#endif
int index_end() override; int index_end() override;
#ifdef HA_CAN_BULK_ACCESS
int pre_index_end();
#endif
int index_read_map( int index_read_map(
uchar *buf, uchar *buf,
const uchar *key, const uchar *key,
@@ -345,15 +315,7 @@ public:
int rnd_init( int rnd_init(
bool scan bool scan
) override; ) override;
#ifdef HA_CAN_BULK_ACCESS
int pre_rnd_init(
bool scan
);
#endif
int rnd_end() override; int rnd_end() override;
#ifdef HA_CAN_BULK_ACCESS
int pre_rnd_end();
#endif
int rnd_next( int rnd_next(
uchar *buf uchar *buf
) override; ) override;
@@ -467,11 +429,6 @@ public:
int write_row( int write_row(
const uchar *buf const uchar *buf
) override; ) override;
#ifdef HA_CAN_BULK_ACCESS
int pre_write_row(
uchar *buf
);
#endif
void direct_update_init( void direct_update_init(
THD *thd, THD *thd,
bool hs_request bool hs_request
@@ -514,27 +471,6 @@ public:
List<Item> *update_fields List<Item> *update_fields
) override; ) override;
#endif #endif
#ifdef HA_CAN_BULK_ACCESS
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int pre_direct_update_rows_init(
List<Item> *update_fields
) {
return pre_direct_update_rows_init(update_fields, 2, NULL, 0, FALSE, NULL);
}
int pre_direct_update_rows_init(
List<Item> *update_fields,
uint mode,
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
uchar *new_data
);
#else
int pre_direct_update_rows_init(
List<Item> *update_fields
);
#endif
#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int direct_update_rows(ha_rows *update_rows, ha_rows *found_rows) inline int direct_update_rows(ha_rows *update_rows, ha_rows *found_rows)
{ {
@@ -553,28 +489,6 @@ public:
ha_rows *update_rows, ha_rows *update_rows,
ha_rows *found_row ha_rows *found_row
) override; ) override;
#endif
#ifdef HA_CAN_BULK_ACCESS
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int pre_direct_update_rows()
{
ha_rows update_rows;
ha_rows found_rows;
return pre_direct_update_rows(NULL, 0, FALSE, NULL, &update_rows,
&found_rows);
}
int pre_direct_update_rows(
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
uchar *new_data,
ha_rows *update_rows,
ha_rows *found_row
);
#else
int pre_direct_update_rows();
#endif
#endif #endif
bool start_bulk_delete() override; bool start_bulk_delete() override;
int end_bulk_delete() override; int end_bulk_delete() override;
@@ -600,22 +514,6 @@ public:
#else #else
int direct_delete_rows_init() override; int direct_delete_rows_init() override;
#endif #endif
#ifdef HA_CAN_BULK_ACCESS
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int pre_direct_delete_rows_init()
{
return pre_direct_delete_rows_init(2, NULL, 0, FALSE);
}
int pre_direct_delete_rows_init(
uint mode,
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted
);
#else
int pre_direct_delete_rows_init();
#endif
#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int direct_delete_rows(ha_rows *delete_rows) inline int direct_delete_rows(ha_rows *delete_rows)
{ {
@@ -631,24 +529,6 @@ public:
int direct_delete_rows( int direct_delete_rows(
ha_rows *delete_rows ha_rows *delete_rows
) override; ) override;
#endif
#ifdef HA_CAN_BULK_ACCESS
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int pre_direct_delete_rows()
{
ha_rows delete_rows;
return pre_direct_delete_rows(NULL, 0, FALSE, &delete_rows);
}
int pre_direct_delete_rows(
KEY_MULTI_RANGE *ranges,
uint range_count,
bool sorted,
ha_rows *delete_rows
);
#else
int pre_direct_delete_rows();
#endif
#endif #endif
int delete_all_rows() override; int delete_all_rows() override;
int truncate() override; int truncate() override;
@@ -658,9 +538,6 @@ public:
uint ranges, uint ranges,
ha_rows rows ha_rows rows
) override; ) override;
#ifdef HA_CAN_BULK_ACCESS
void bulk_req_exec();
#endif
const key_map *keys_to_use_for_scanning() override; const key_map *keys_to_use_for_scanning() override;
ha_rows estimate_rows_upper_bound() override; ha_rows estimate_rows_upper_bound() override;
void print_error( void print_error(
@@ -818,15 +695,6 @@ public:
bool use_parallel bool use_parallel
); );
void check_insert_dup_update_pushdown(); void check_insert_dup_update_pushdown();
#ifdef HA_CAN_BULK_ACCESS
SPIDER_BULK_ACCESS_LINK *create_bulk_access_link();
void delete_bulk_access_link(
SPIDER_BULK_ACCESS_LINK *bulk_access_link
);
int sync_from_clone_source(
ha_spider *spider
);
#endif
void sync_from_clone_source_base( void sync_from_clone_source_base(
ha_spider *spider ha_spider *spider
); );
@@ -1044,15 +912,6 @@ public:
int append_lock_tables_list(); int append_lock_tables_list();
int lock_tables(); int lock_tables();
int dml_init(); int dml_init();
#ifdef HA_CAN_BULK_ACCESS
int bulk_access_begin(
void *info
);
int bulk_access_current(
void *info
);
void bulk_access_end();
#endif
}; };

View File

@@ -2590,13 +2590,6 @@ void *spider_bg_conn_action(
pthread_mutex_lock(&conn->mta_conn_mutex); pthread_mutex_lock(&conn->mta_conn_mutex);
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL; sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
DBUG_PRINT("info",("spider sql_type=%lu", sql_type)); DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
#ifdef HA_CAN_BULK_ACCESS
if (spider->is_bulk_access_clone)
{
spider->connection_ids[conn->link_idx] = conn->connection_id;
spider_trx_add_bulk_access_conn(spider->trx, conn);
}
#endif
if (!result_list->bgs_error) if (!result_list->bgs_error)
{ {
conn->need_mon = &spider->need_mons[conn->link_idx]; conn->need_mon = &spider->need_mons[conn->link_idx];
@@ -2604,10 +2597,6 @@ void *spider_bg_conn_action(
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = TRUE; conn->mta_conn_mutex_lock_already = TRUE;
conn->mta_conn_mutex_unlock_later = TRUE; conn->mta_conn_mutex_unlock_later = TRUE;
#ifdef HA_CAN_BULK_ACCESS
if (!spider->is_bulk_access_clone)
{
#endif
if (!(result_list->bgs_error = if (!(result_list->bgs_error =
spider_db_set_names(spider, conn, conn->link_idx))) spider_db_set_names(spider, conn, conn->link_idx)))
{ {
@@ -2676,9 +2665,6 @@ void *spider_bg_conn_action(
strmov(result_list->bgs_error_msg, strmov(result_list->bgs_error_msg,
spider_stmt_da_message(thd)); spider_stmt_da_message(thd));
} }
#ifdef HA_CAN_BULK_ACCESS
}
#endif
DBUG_ASSERT(conn->mta_conn_mutex_lock_already); DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE; conn->mta_conn_mutex_lock_already = FALSE;

View File

@@ -4476,42 +4476,6 @@ void spider_db_discard_multiple_result(
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_store_result(
ha_spider *spider,
SPIDER_CONN *conn,
int link_idx,
bool discard_result
) {
int error_num, tmp_error_num;
DBUG_ENTER("spider_db_bulk_store_result");
DBUG_PRINT("info",("spider spider=%p", spider));
DBUG_PRINT("info",("spider conn=%p", conn));
DBUG_PRINT("info",("spider link_idx=%d", link_idx));
if (conn->conn_kind == SPIDER_CONN_KIND_MYSQL)
{
/* already stored */
DBUG_RETURN(0);
}
error_num = spider_db_bulk_open_handler(spider, conn, link_idx);
if (!discard_result)
{
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_unlock_later = TRUE;
if ((tmp_error_num = spider_db_store_result(spider, link_idx,
spider->get_table())))
{
error_num = tmp_error_num;
}
conn->mta_conn_mutex_unlock_later = FALSE;
} else {
if (spider->connection_ids[link_idx] == conn->connection_id)
spider_db_discard_result(spider, link_idx, conn);
}
DBUG_RETURN(error_num);
}
#endif
int spider_db_fetch( int spider_db_fetch(
uchar *buf, uchar *buf,
@@ -6070,10 +6034,6 @@ int spider_db_bulk_insert(
spider->set_insert_to_pos_sql(SPIDER_SQL_TYPE_INSERT_SQL); spider->set_insert_to_pos_sql(SPIDER_SQL_TYPE_INSERT_SQL);
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
#ifdef HA_CAN_BULK_ACCESS
if (!spider->is_bulk_access_clone)
{
#endif
bool insert_info = FALSE; bool insert_info = FALSE;
for ( for (
roop_count2 = spider_conn_link_idx_next(share->link_statuses, roop_count2 = spider_conn_link_idx_next(share->link_statuses,
@@ -6254,9 +6214,6 @@ int spider_db_bulk_insert(
conn->mta_conn_mutex_unlock_later = FALSE; conn->mta_conn_mutex_unlock_later = FALSE;
pthread_mutex_unlock(&conn->mta_conn_mutex); pthread_mutex_unlock(&conn->mta_conn_mutex);
spider->store_last_insert_id = 0; spider->store_last_insert_id = 0;
#ifdef HA_CAN_BULK_ACCESS
}
#endif
} }
if ( if (
(bulk_end || !spider->bulk_insert) && (bulk_end || !spider->bulk_insert) &&
@@ -6266,91 +6223,6 @@ int spider_db_bulk_insert(
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_bulk_insert(
ha_spider *spider
) {
int error_num = 0, first_insert_link_idx = -1, tmp_error_num;
int roop_count2;
SPIDER_SHARE *share = spider->share;
SPIDER_CONN *conn, *first_insert_conn = NULL;
TABLE *table = spider->get_table();
THD *thd = spider->wide_handler->trx->thd;
DBUG_ENTER("spider_db_bulk_bulk_insert");
for (
roop_count2 = spider_conn_link_idx_next(share->link_statuses,
spider->conn_link_idx, -1, share->link_count,
SPIDER_LINK_STATUS_RECOVERY);
roop_count2 < (int) share->link_count;
roop_count2 = spider_conn_link_idx_next(share->link_statuses,
spider->conn_link_idx, roop_count2, share->link_count,
SPIDER_LINK_STATUS_RECOVERY)
) {
conn = spider->conns[roop_count2];
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
pthread_mutex_lock(&conn->mta_conn_mutex);
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = TRUE;
conn->mta_conn_mutex_unlock_later = TRUE;
if ((tmp_error_num = spider_db_bulk_open_handler(spider, conn,
roop_count2)))
{
error_num = tmp_error_num;
}
DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE;
pthread_mutex_unlock(&conn->mta_conn_mutex);
if (first_insert_link_idx == -1)
{
first_insert_link_idx = roop_count2;
first_insert_conn = conn;
}
}
conn = first_insert_conn;
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
pthread_mutex_lock(&conn->mta_conn_mutex);
conn->need_mon = &spider->need_mons[first_insert_link_idx];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = TRUE;
conn->mta_conn_mutex_unlock_later = TRUE;
if (table->next_number_field &&
(
!table->auto_increment_field_not_null ||
(
!table->next_number_field->val_int() &&
!(thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
)
)
) {
ulonglong last_insert_id;
if (spider->store_last_insert_id)
last_insert_id = spider->store_last_insert_id;
else
last_insert_id = conn->db_conn->last_insert_id();
table->next_number_field->set_notnull();
if (
(tmp_error_num = spider_db_update_auto_increment(spider,
first_insert_link_idx)) ||
(tmp_error_num = table->next_number_field->store(
last_insert_id, TRUE))
) {
error_num = tmp_error_num;
}
}
DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE;
pthread_mutex_unlock(&conn->mta_conn_mutex);
spider->store_last_insert_id = 0;
DBUG_RETURN(error_num);
}
#endif
int spider_db_update_auto_increment( int spider_db_update_auto_increment(
ha_spider *spider, ha_spider *spider,
@@ -6917,13 +6789,6 @@ int spider_db_direct_update(
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
pthread_mutex_lock(&conn->mta_conn_mutex); pthread_mutex_lock(&conn->mta_conn_mutex);
#ifdef HA_CAN_BULK_ACCESS
if (spider->is_bulk_access_clone)
{
spider->connection_ids[roop_count] = conn->connection_id;
spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
} else {
#endif
conn->need_mon = &spider->need_mons[roop_count]; conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7014,9 +6879,6 @@ int spider_db_direct_update(
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE; conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE; conn->mta_conn_mutex_unlock_later = FALSE;
#ifdef HA_CAN_BULK_ACCESS
}
#endif
pthread_mutex_unlock(&conn->mta_conn_mutex); pthread_mutex_unlock(&conn->mta_conn_mutex);
} }
spider->reset_sql_sql(SPIDER_SQL_TYPE_UPDATE_SQL); spider->reset_sql_sql(SPIDER_SQL_TYPE_UPDATE_SQL);
@@ -7125,13 +6987,6 @@ int spider_db_direct_update(
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
pthread_mutex_lock(&conn->mta_conn_mutex); pthread_mutex_lock(&conn->mta_conn_mutex);
#ifdef HA_CAN_BULK_ACCESS
if (spider->is_bulk_access_clone)
{
spider->connection_ids[roop_count] = conn->connection_id;
spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
} else {
#endif
conn->need_mon = &spider->need_mons[roop_count]; conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7223,9 +7078,6 @@ int spider_db_direct_update(
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE; conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE; conn->mta_conn_mutex_unlock_later = FALSE;
#ifdef HA_CAN_BULK_ACCESS
}
#endif
pthread_mutex_unlock(&conn->mta_conn_mutex); pthread_mutex_unlock(&conn->mta_conn_mutex);
} }
spider->reset_sql_sql(SPIDER_SQL_TYPE_UPDATE_SQL); spider->reset_sql_sql(SPIDER_SQL_TYPE_UPDATE_SQL);
@@ -7233,56 +7085,6 @@ int spider_db_direct_update(
} }
#endif #endif
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_direct_update(
ha_spider *spider,
ha_rows *update_rows,
ha_rows *found_rows
) {
int error_num = 0, roop_count, tmp_error_num;
SPIDER_SHARE *share = spider->share;
SPIDER_CONN *conn;
bool counted = FALSE;
DBUG_ENTER("spider_db_bulk_direct_update");
for (
roop_count = spider_conn_link_idx_next(share->link_statuses,
spider->conn_link_idx, -1, share->link_count,
SPIDER_LINK_STATUS_RECOVERY);
roop_count < (int) share->link_count;
roop_count = spider_conn_link_idx_next(share->link_statuses,
spider->conn_link_idx, roop_count, share->link_count,
SPIDER_LINK_STATUS_RECOVERY)
) {
DBUG_PRINT("info", ("spider exec sql"));
conn = spider->conns[roop_count];
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
pthread_mutex_lock(&conn->mta_conn_mutex);
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = TRUE;
conn->mta_conn_mutex_unlock_later = TRUE;
if ((tmp_error_num = spider_db_bulk_open_handler(spider, conn,
roop_count)))
{
error_num = tmp_error_num;
}
if (!counted)
{
*update_rows = spider->conns[roop_count]->db_conn->affected_rows();
DBUG_PRINT("info", ("spider update_rows = %llu", *update_rows));
*found_rows = spider->conns[roop_count]->db_conn->matched_rows();
DBUG_PRINT("info", ("spider found_rows = %llu", *found_rows));
counted = TRUE;
}
DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE;
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
DBUG_RETURN(error_num);
}
#endif
int spider_db_bulk_delete( int spider_db_bulk_delete(
ha_spider *spider, ha_spider *spider,
@@ -7447,13 +7249,6 @@ int spider_db_direct_delete(
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
pthread_mutex_lock(&conn->mta_conn_mutex); pthread_mutex_lock(&conn->mta_conn_mutex);
#ifdef HA_CAN_BULK_ACCESS
if (spider->is_bulk_access_clone)
{
spider->connection_ids[roop_count] = conn->connection_id;
spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
} else {
#endif
conn->need_mon = &spider->need_mons[roop_count]; conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7536,9 +7331,6 @@ int spider_db_direct_delete(
DBUG_PRINT("info", ("spider delete_rows = %llu", *delete_rows)); DBUG_PRINT("info", ("spider delete_rows = %llu", *delete_rows));
counted = TRUE; counted = TRUE;
} }
#ifdef HA_CAN_BULK_ACCESS
}
#endif
pthread_mutex_unlock(&conn->mta_conn_mutex); pthread_mutex_unlock(&conn->mta_conn_mutex);
} }
int error_num2 = 0; int error_num2 = 0;
@@ -7623,13 +7415,6 @@ int spider_db_direct_delete(
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
pthread_mutex_lock(&conn->mta_conn_mutex); pthread_mutex_lock(&conn->mta_conn_mutex);
#ifdef HA_CAN_BULK_ACCESS
if (spider->is_bulk_access_clone)
{
spider->connection_ids[roop_count] = conn->connection_id;
spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
} else {
#endif
conn->need_mon = &spider->need_mons[roop_count]; conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7712,9 +7497,6 @@ int spider_db_direct_delete(
DBUG_PRINT("info", ("spider delete_rows = %llu", *delete_rows)); DBUG_PRINT("info", ("spider delete_rows = %llu", *delete_rows));
counted = TRUE; counted = TRUE;
} }
#ifdef HA_CAN_BULK_ACCESS
}
#endif
pthread_mutex_unlock(&conn->mta_conn_mutex); pthread_mutex_unlock(&conn->mta_conn_mutex);
} }
int error_num2 = 0; int error_num2 = 0;
@@ -11146,20 +10928,6 @@ error:
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_open_handler(
ha_spider *spider,
SPIDER_CONN *conn,
int link_idx
) {
int error_num = 0;
DBUG_ENTER("spider_db_bulk_open_handler");
DBUG_PRINT("info",("spider spider=%p", spider));
DBUG_PRINT("info",("spider conn=%p", conn));
DBUG_PRINT("info",("spider link_idx=%d", link_idx));
DBUG_RETURN(error_num);
}
#endif
int spider_db_close_handler( int spider_db_close_handler(
ha_spider *spider, ha_spider *spider,

View File

@@ -634,14 +634,6 @@ void spider_db_discard_multiple_result(
SPIDER_CONN *conn SPIDER_CONN *conn
); );
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_store_result(
ha_spider *spider,
SPIDER_CONN *conn,
int link_idx,
bool discard_result
);
#endif
int spider_db_fetch( int spider_db_fetch(
uchar *buf, uchar *buf,
@@ -764,11 +756,6 @@ int spider_db_bulk_insert(
bool bulk_end bool bulk_end
); );
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_bulk_insert(
ha_spider *spider
);
#endif
int spider_db_update_auto_increment( int spider_db_update_auto_increment(
ha_spider *spider, ha_spider *spider,
@@ -815,12 +802,6 @@ int spider_db_direct_update(
); );
#endif #endif
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_direct_update(
ha_spider *spider,
ha_rows *update_rows
);
#endif
int spider_db_bulk_delete( int spider_db_bulk_delete(
ha_spider *spider, ha_spider *spider,
@@ -1190,13 +1171,6 @@ int spider_db_open_handler(
int link_idx int link_idx
); );
#ifdef HA_CAN_BULK_ACCESS
int spider_db_bulk_open_handler(
ha_spider *spider,
SPIDER_CONN *conn,
int link_idx
);
#endif
int spider_db_close_handler( int spider_db_close_handler(
ha_spider *spider, ha_spider *spider,

View File

@@ -1766,8 +1766,6 @@ typedef struct st_spider_result_list
SPIDER_RESULT *current; SPIDER_RESULT *current;
KEY *key_info; KEY *key_info;
int key_order; int key_order;
#ifdef HA_CAN_BULK_ACCESS
#endif
spider_string *sqls; spider_string *sqls;
int ha_read_kind; int ha_read_kind;
bool have_sql_kind_backup; bool have_sql_kind_backup;

View File

@@ -15005,11 +15005,7 @@ void spider_mbase_handler::minimum_select_bitmap_create()
memset(minimum_select_bitmap, 0, no_bytes_in_map(table->read_set)); memset(minimum_select_bitmap, 0, no_bytes_in_map(table->read_set));
if ( if (
spider->use_index_merge || spider->use_index_merge ||
#ifdef HA_CAN_BULK_ACCESS
(spider->is_clone && !spider->is_bulk_access_clone)
#else
spider->is_clone spider->is_clone
#endif
) { ) {
/* need preparing for cmp_ref */ /* need preparing for cmp_ref */
TABLE_SHARE *table_share = table->s; TABLE_SHARE *table_share = table->s;

View File

@@ -12167,11 +12167,7 @@ void spider_oracle_handler::minimum_select_bitmap_create()
memset(minimum_select_bitmap, 0, no_bytes_in_map(table->read_set)); memset(minimum_select_bitmap, 0, no_bytes_in_map(table->read_set));
if ( if (
spider->use_index_merge || spider->use_index_merge ||
#ifdef HA_CAN_BULK_ACCESS
(spider->is_clone && !spider->is_bulk_access_clone)
#else
spider->is_clone spider->is_clone
#endif
) { ) {
/* need preparing for cmp_ref */ /* need preparing for cmp_ref */
TABLE_SHARE *table_share = table->s; TABLE_SHARE *table_share = table->s;

View File

@@ -745,12 +745,6 @@ typedef struct st_spider_conn
Time_zone *queued_time_zone_val; Time_zone *queued_time_zone_val;
XID *queued_xa_start_xid; XID *queued_xa_start_xid;
#ifdef HA_CAN_BULK_ACCESS
uint bulk_access_requests;
uint bulk_access_sended;
int bulk_access_error_num;
st_spider_conn *bulk_access_next;
#endif
bool disable_connect_retry; /* TRUE if it is unnecessary to bool disable_connect_retry; /* TRUE if it is unnecessary to
retry to connect after a retry to connect after a
@@ -878,9 +872,6 @@ typedef struct st_spider_wide_handler
uint top_table_fields; uint top_table_fields;
#ifdef INFO_KIND_FORCE_LIMIT_BEGIN #ifdef INFO_KIND_FORCE_LIMIT_BEGIN
longlong info_limit; longlong info_limit;
#endif
#ifdef HA_CAN_BULK_ACCESS
ulonglong external_lock_cnt;
#endif #endif
bool between_flg; bool between_flg;
bool idx_bitmap_is_set; bool idx_bitmap_is_set;
@@ -954,10 +945,6 @@ typedef struct st_spider_transaction
ulonglong direct_aggregate_count; ulonglong direct_aggregate_count;
ulonglong parallel_search_count; ulonglong parallel_search_count;
#ifdef HA_CAN_BULK_ACCESS
SPIDER_CONN *bulk_access_conn_first;
SPIDER_CONN *bulk_access_conn_last;
#endif
pthread_mutex_t *udf_table_mutexes; pthread_mutex_t *udf_table_mutexes;
CHARSET_INFO *udf_access_charset; CHARSET_INFO *udf_access_charset;
@@ -1175,9 +1162,6 @@ typedef struct st_spider_share
int error_read_mode; int error_read_mode;
int error_write_mode; int error_write_mode;
int active_link_count; int active_link_count;
#ifdef HA_CAN_BULK_ACCESS
int bulk_access_free;
#endif
#ifdef HA_CAN_FORCE_BULK_UPDATE #ifdef HA_CAN_FORCE_BULK_UPDATE
int force_bulk_update; int force_bulk_update;
#endif #endif
@@ -1583,17 +1567,6 @@ typedef struct st_spider_trx_ha
bool wait_for_reusing; bool wait_for_reusing;
} SPIDER_TRX_HA; } SPIDER_TRX_HA;
#ifdef HA_CAN_BULK_ACCESS
typedef struct st_spider_bulk_access_link
{
ha_spider *spider;
uint sequence_num;
bool used;
bool called;
MEM_ROOT mem_root;
st_spider_bulk_access_link *next;
} SPIDER_BULK_ACCESS_LINK;
#endif
#define SPIDER_INT_HLD_TGT_SIZE 100 #define SPIDER_INT_HLD_TGT_SIZE 100
typedef struct st_spider_int_hld typedef struct st_spider_int_hld

View File

@@ -2033,28 +2033,6 @@ static MYSQL_THDVAR_INT(
SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, read_only_mode) SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, read_only_mode)
#ifdef HA_CAN_BULK_ACCESS
static int spider_bulk_access_free;
/*
-1 :fallback to default
0 :in reset
1 :in close
*/
static MYSQL_SYSVAR_INT(
bulk_access_free,
spider_bulk_access_free,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Free mode of bulk access resources",
NULL,
NULL,
0,
-1,
1,
0
);
SPIDER_SYSVAR_OVERRIDE_VALUE_FUN(int, bulk_access_free)
#endif
/* /*
-1 :fallback to default -1 :fallback to default
@@ -2657,9 +2635,6 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(skip_parallel_search), MYSQL_SYSVAR(skip_parallel_search),
MYSQL_SYSVAR(direct_order_limit), MYSQL_SYSVAR(direct_order_limit),
MYSQL_SYSVAR(read_only_mode), MYSQL_SYSVAR(read_only_mode),
#ifdef HA_CAN_BULK_ACCESS
MYSQL_SYSVAR(bulk_access_free),
#endif
MYSQL_SYSVAR(udf_ds_use_real_table), MYSQL_SYSVAR(udf_ds_use_real_table),
MYSQL_SYSVAR(general_log), MYSQL_SYSVAR(general_log),
MYSQL_SYSVAR(index_hint_pushdown), MYSQL_SYSVAR(index_hint_pushdown),

View File

@@ -337,11 +337,6 @@ int spider_param_read_only_mode(
THD *thd, THD *thd,
int read_only_mode int read_only_mode
); );
#ifdef HA_CAN_BULK_ACCESS
int spider_param_bulk_access_free(
int bulk_access_free
);
#endif
int spider_param_udf_ds_use_real_table( int spider_param_udf_ds_use_real_table(
THD *thd, THD *thd,
int udf_ds_use_real_table int udf_ds_use_real_table

View File

@@ -1834,9 +1834,6 @@ static void spider_minus_1(SPIDER_SHARE *share, TABLE_SHARE *table_share)
share->error_read_mode = -1; share->error_read_mode = -1;
share->error_write_mode = -1; share->error_write_mode = -1;
share->active_link_count = -1; share->active_link_count = -1;
#ifdef HA_CAN_BULK_ACCESS
share->bulk_access_free = -1;
#endif
#ifdef HA_CAN_FORCE_BULK_UPDATE #ifdef HA_CAN_FORCE_BULK_UPDATE
share->force_bulk_update = -1; share->force_bulk_update = -1;
#endif #endif
@@ -2160,9 +2157,6 @@ int spider_parse_connect_info(
2147483647); 2147483647);
SPIDER_PARAM_INT_WITH_MAX("aim", auto_increment_mode, 0, 3); SPIDER_PARAM_INT_WITH_MAX("aim", auto_increment_mode, 0, 3);
SPIDER_PARAM_INT("alc", active_link_count, 1); SPIDER_PARAM_INT("alc", active_link_count, 1);
#ifdef HA_CAN_BULK_ACCESS
SPIDER_PARAM_INT_WITH_MAX("baf", bulk_access_free, 0, 1);
#endif
SPIDER_PARAM_INT("bfz", buffer_size, 0); SPIDER_PARAM_INT("bfz", buffer_size, 0);
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0); SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0);
@@ -2419,10 +2413,6 @@ int spider_parse_connect_info(
net_read_timeouts, 0, 2147483647); net_read_timeouts, 0, 2147483647);
SPIDER_PARAM_INT_WITH_MAX( SPIDER_PARAM_INT_WITH_MAX(
"error_write_mode", error_write_mode, 0, 1); "error_write_mode", error_write_mode, 0, 1);
#ifdef HA_CAN_BULK_ACCESS
SPIDER_PARAM_INT_WITH_MAX(
"bulk_access_free", bulk_access_free, 0, 1);
#endif
SPIDER_PARAM_INT_WITH_MAX( SPIDER_PARAM_INT_WITH_MAX(
"query_cache_sync", query_cache_sync, 0, 3); "query_cache_sync", query_cache_sync, 0, 3);
error_num = parse.fail(true); error_num = parse.fail(true);
@@ -4549,8 +4539,6 @@ SPIDER_SHARE *spider_get_share(
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
&result_list->tmp_table_created, &result_list->tmp_table_created,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
#ifdef HA_CAN_BULK_ACCESS
#endif
&result_list->sql_kind_backup, sizeof(uint) * share->link_count, &result_list->sql_kind_backup, sizeof(uint) * share->link_count,
&result_list->casual_read, sizeof(int) * share->link_count, &result_list->casual_read, sizeof(int) * share->link_count,
&spider->dbton_handler, &spider->dbton_handler,
@@ -5027,8 +5015,6 @@ SPIDER_SHARE *spider_get_share(
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
&result_list->tmp_table_created, &result_list->tmp_table_created,
sizeof(uchar) * share->link_bitmap_size, sizeof(uchar) * share->link_bitmap_size,
#ifdef HA_CAN_BULK_ACCESS
#endif
&result_list->sql_kind_backup, sizeof(uint) * share->link_count, &result_list->sql_kind_backup, sizeof(uint) * share->link_count,
&result_list->casual_read, sizeof(int) * share->link_count, &result_list->casual_read, sizeof(int) * share->link_count,
&spider->dbton_handler, &spider->dbton_handler,
@@ -7733,18 +7719,10 @@ bool spider_check_direct_order_limit(
spider->use_index_merge ? "TRUE" : "FALSE")); spider->use_index_merge ? "TRUE" : "FALSE"));
DBUG_PRINT("info",("spider is_clone=%s", DBUG_PRINT("info",("spider is_clone=%s",
spider->is_clone ? "TRUE" : "FALSE")); spider->is_clone ? "TRUE" : "FALSE"));
#ifdef HA_CAN_BULK_ACCESS
DBUG_PRINT("info",("spider is_bulk_access_clone=%s",
spider->is_bulk_access_clone ? "TRUE" : "FALSE"));
#endif
if ( if (
spider->wide_handler->sql_command != SQLCOM_HA_READ && spider->wide_handler->sql_command != SQLCOM_HA_READ &&
!spider->use_index_merge && !spider->use_index_merge &&
#ifdef HA_CAN_BULK_ACCESS
(!spider->is_clone || spider->is_bulk_access_clone)
#else
!spider->is_clone !spider->is_clone
#endif
) { ) {
spider_get_select_limit(spider, &select_lex, &select_limit, &offset_limit); spider_get_select_limit(spider, &select_lex, &select_limit, &offset_limit);
bool first_check = TRUE; bool first_check = TRUE;
@@ -7946,12 +7924,6 @@ Field *spider_field_exchange(
Field *field Field *field
) { ) {
DBUG_ENTER("spider_field_exchange"); DBUG_ENTER("spider_field_exchange");
#ifdef HA_CAN_BULK_ACCESS
if (handler->is_bulk_access_clone)
{
handler = handler->pt_clone_source_handler;
}
#endif
DBUG_PRINT("info",("spider in field=%p", field)); DBUG_PRINT("info",("spider in field=%p", field));
DBUG_PRINT("info",("spider in field->table=%p", field->table)); DBUG_PRINT("info",("spider in field->table=%p", field->table));
DBUG_PRINT("info",("spider table=%p", handler->get_table())); DBUG_PRINT("info",("spider table=%p", handler->get_table()));

View File

@@ -3097,11 +3097,6 @@ int spider_commit(
if (!(trx = (SPIDER_TRX*) thd_get_ha_data(thd, spider_hton_ptr))) if (!(trx = (SPIDER_TRX*) thd_get_ha_data(thd, spider_hton_ptr)))
DBUG_RETURN(0); /* transaction is not started */ DBUG_RETURN(0); /* transaction is not started */
#ifdef HA_CAN_BULK_ACCESS
DBUG_PRINT("info",("spider trx->bulk_access_conn_first=%p",
trx->bulk_access_conn_first));
trx->bulk_access_conn_first = NULL;
#endif
/* /*
We do (almost) nothing if the following two conditions are both met: We do (almost) nothing if the following two conditions are both met:
@@ -3195,11 +3190,6 @@ int spider_rollback(
if (!(trx = (SPIDER_TRX*) thd_get_ha_data(thd, spider_hton_ptr))) if (!(trx = (SPIDER_TRX*) thd_get_ha_data(thd, spider_hton_ptr)))
DBUG_RETURN(0); /* transaction is not started */ DBUG_RETURN(0); /* transaction is not started */
#ifdef HA_CAN_BULK_ACCESS
DBUG_PRINT("info",("spider trx->bulk_access_conn_first=%p",
trx->bulk_access_conn_first));
trx->bulk_access_conn_first = NULL;
#endif
/* In case the rollback happens due to failure of LOCK TABLE, we /* In case the rollback happens due to failure of LOCK TABLE, we
need to clear the list of tables to lock. */ need to clear the list of tables to lock. */
@@ -3936,34 +3926,3 @@ int spider_trx_check_link_idx_failed(
DBUG_RETURN(0); DBUG_RETURN(0);
} }
#ifdef HA_CAN_BULK_ACCESS
void spider_trx_add_bulk_access_conn(
SPIDER_TRX *trx,
SPIDER_CONN *conn
) {
DBUG_ENTER("spider_trx_add_bulk_access_conn");
DBUG_PRINT("info",("spider trx=%p", trx));
DBUG_PRINT("info",("spider conn=%p", conn));
DBUG_PRINT("info",("spider conn->bulk_access_requests=%u",
conn->bulk_access_requests));
DBUG_PRINT("info",("spider conn->bulk_access_sended=%u",
conn->bulk_access_sended));
DBUG_PRINT("info",("spider trx->bulk_access_conn_first=%p",
trx->bulk_access_conn_first));
if (!conn->bulk_access_requests && !conn->bulk_access_sended)
{
if (!trx->bulk_access_conn_first)
{
trx->bulk_access_conn_first = conn;
} else {
trx->bulk_access_conn_last->bulk_access_next = conn;
}
trx->bulk_access_conn_last = conn;
conn->bulk_access_next = NULL;
}
conn->bulk_access_requests++;
DBUG_PRINT("info",("spider conn->bulk_access_requests=%u",
conn->bulk_access_requests));
DBUG_VOID_RETURN;
}
#endif

View File

@@ -266,9 +266,3 @@ int spider_trx_check_link_idx_failed(
ha_spider *spider ha_spider *spider
); );
#ifdef HA_CAN_BULK_ACCESS
void spider_trx_add_bulk_access_conn(
SPIDER_TRX *trx,
SPIDER_CONN *conn
);
#endif