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:
File diff suppressed because it is too large
Load Diff
@@ -85,21 +85,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;
|
||||||
@@ -222,12 +207,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,
|
||||||
@@ -249,16 +228,7 @@ public:
|
|||||||
uint idx,
|
uint idx,
|
||||||
bool sorted
|
bool sorted
|
||||||
);
|
);
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
int pre_index_init(
|
|
||||||
uint idx,
|
|
||||||
bool sorted
|
|
||||||
);
|
|
||||||
#endif
|
|
||||||
int index_end();
|
int index_end();
|
||||||
#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,
|
||||||
@@ -346,15 +316,7 @@ public:
|
|||||||
int rnd_init(
|
int rnd_init(
|
||||||
bool scan
|
bool scan
|
||||||
);
|
);
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
int pre_rnd_init(
|
|
||||||
bool scan
|
|
||||||
);
|
|
||||||
#endif
|
|
||||||
int rnd_end();
|
int rnd_end();
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
int pre_rnd_end();
|
|
||||||
#endif
|
|
||||||
int rnd_next(
|
int rnd_next(
|
||||||
uchar *buf
|
uchar *buf
|
||||||
);
|
);
|
||||||
@@ -480,11 +442,6 @@ public:
|
|||||||
int write_row(
|
int write_row(
|
||||||
const uchar *buf
|
const uchar *buf
|
||||||
);
|
);
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
int pre_write_row(
|
|
||||||
uchar *buf
|
|
||||||
);
|
|
||||||
#endif
|
|
||||||
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
|
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
|
||||||
void direct_update_init(
|
void direct_update_init(
|
||||||
THD *thd,
|
THD *thd,
|
||||||
@@ -560,45 +517,6 @@ public:
|
|||||||
int direct_update_rows_init();
|
int direct_update_rows_init();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
|
|
||||||
#ifdef SPIDER_MDEV_16246
|
|
||||||
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
|
|
||||||
inline int pre_direct_update_rows_init()
|
|
||||||
{
|
|
||||||
return pre_direct_update_rows_init(2, NULL, 0, FALSE, NULL);
|
|
||||||
}
|
|
||||||
int pre_direct_update_rows_init(
|
|
||||||
uint mode,
|
|
||||||
KEY_MULTI_RANGE *ranges,
|
|
||||||
uint range_count,
|
|
||||||
bool sorted,
|
|
||||||
uchar *new_data
|
|
||||||
);
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifdef SPIDER_MDEV_16246
|
|
||||||
int pre_direct_update_rows_init(
|
|
||||||
List<Item> *update_fields
|
|
||||||
);
|
|
||||||
#else
|
|
||||||
int pre_direct_update_rows_init();
|
|
||||||
#endif
|
|
||||||
#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)
|
||||||
{
|
{
|
||||||
@@ -618,28 +536,6 @@ public:
|
|||||||
ha_rows *found_row
|
ha_rows *found_row
|
||||||
);
|
);
|
||||||
#endif
|
#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
|
#endif
|
||||||
bool start_bulk_delete();
|
bool start_bulk_delete();
|
||||||
int end_bulk_delete();
|
int end_bulk_delete();
|
||||||
@@ -666,22 +562,6 @@ public:
|
|||||||
#else
|
#else
|
||||||
int direct_delete_rows_init();
|
int direct_delete_rows_init();
|
||||||
#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)
|
||||||
{
|
{
|
||||||
@@ -698,24 +578,6 @@ public:
|
|||||||
ha_rows *delete_rows
|
ha_rows *delete_rows
|
||||||
);
|
);
|
||||||
#endif
|
#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
|
#endif
|
||||||
int delete_all_rows();
|
int delete_all_rows();
|
||||||
int truncate();
|
int truncate();
|
||||||
@@ -725,9 +587,6 @@ public:
|
|||||||
uint ranges,
|
uint ranges,
|
||||||
ha_rows rows
|
ha_rows rows
|
||||||
);
|
);
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
void bulk_req_exec();
|
|
||||||
#endif
|
|
||||||
const key_map *keys_to_use_for_scanning();
|
const key_map *keys_to_use_for_scanning();
|
||||||
ha_rows estimate_rows_upper_bound();
|
ha_rows estimate_rows_upper_bound();
|
||||||
void print_error(
|
void print_error(
|
||||||
@@ -888,15 +747,6 @@ public:
|
|||||||
);
|
);
|
||||||
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
|
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
|
||||||
void check_insert_dup_update_pushdown();
|
void check_insert_dup_update_pushdown();
|
||||||
#endif
|
|
||||||
#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
|
#endif
|
||||||
void sync_from_clone_source_base(
|
void sync_from_clone_source_base(
|
||||||
ha_spider *spider
|
ha_spider *spider
|
||||||
@@ -1123,13 +973,4 @@ 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
|
|
||||||
};
|
};
|
||||||
|
@@ -2704,13 +2704,6 @@ void *spider_bg_conn_action(
|
|||||||
}
|
}
|
||||||
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];
|
||||||
@@ -2718,10 +2711,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)))
|
||||||
{
|
{
|
||||||
@@ -2790,9 +2779,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;
|
||||||
|
@@ -4504,42 +4504,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,
|
||||||
@@ -6182,10 +6146,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,
|
||||||
@@ -6387,9 +6347,6 @@ int spider_db_bulk_insert(
|
|||||||
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);
|
||||||
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) &&
|
||||||
@@ -6399,95 +6356,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);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
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;
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
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);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
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;
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
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,
|
||||||
@@ -7144,13 +7012,6 @@ int spider_db_direct_update(
|
|||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
}
|
||||||
#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);
|
||||||
@@ -7242,9 +7103,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
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -7372,13 +7230,6 @@ int spider_db_direct_update(
|
|||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
}
|
||||||
#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);
|
||||||
@@ -7471,9 +7322,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
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -7483,58 +7331,6 @@ int spider_db_direct_update(
|
|||||||
#endif
|
#endif
|
||||||
#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);
|
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
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;
|
|
||||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
|
||||||
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,
|
||||||
@@ -7733,13 +7529,6 @@ int spider_db_direct_delete(
|
|||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
}
|
||||||
#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);
|
||||||
@@ -7823,9 +7612,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
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -7925,13 +7711,6 @@ int spider_db_direct_delete(
|
|||||||
pthread_mutex_lock(&conn->mta_conn_mutex);
|
pthread_mutex_lock(&conn->mta_conn_mutex);
|
||||||
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||||
}
|
}
|
||||||
#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);
|
||||||
@@ -8015,9 +7794,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
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -11519,20 +11295,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,
|
||||||
|
@@ -639,14 +639,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,
|
||||||
@@ -769,11 +761,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,
|
||||||
@@ -822,12 +809,6 @@ int spider_db_direct_update(
|
|||||||
#endif
|
#endif
|
||||||
#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,
|
||||||
@@ -1205,13 +1186,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,
|
||||||
|
@@ -15914,11 +15914,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;
|
||||||
|
@@ -12357,11 +12357,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;
|
||||||
|
@@ -496,12 +496,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
|
||||||
@@ -629,9 +623,6 @@ typedef struct st_spider_wide_handler
|
|||||||
#ifdef INFO_KIND_FORCE_LIMIT_BEGIN
|
#ifdef INFO_KIND_FORCE_LIMIT_BEGIN
|
||||||
longlong info_limit;
|
longlong info_limit;
|
||||||
#endif
|
#endif
|
||||||
#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;
|
||||||
@@ -708,10 +699,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;
|
||||||
@@ -909,9 +896,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
|
||||||
@@ -1291,17 +1275,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
|
||||||
|
@@ -2513,34 +2513,6 @@ int spider_param_read_only_mode(
|
|||||||
read_only_mode : THDVAR(thd, read_only_mode));
|
read_only_mode : THDVAR(thd, read_only_mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
static int spider_bulk_access_free;
|
|
||||||
/*
|
|
||||||
-1 :use table parameter
|
|
||||||
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,
|
|
||||||
-1,
|
|
||||||
-1,
|
|
||||||
1,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
int spider_param_bulk_access_free(
|
|
||||||
int bulk_access_free
|
|
||||||
) {
|
|
||||||
DBUG_ENTER("spider_param_bulk_access_free");
|
|
||||||
DBUG_RETURN(spider_bulk_access_free == -1 ?
|
|
||||||
bulk_access_free : spider_bulk_access_free);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
-1 :use UDF parameter
|
-1 :use UDF parameter
|
||||||
@@ -3234,9 +3206,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),
|
||||||
|
@@ -331,11 +331,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
|
||||||
|
@@ -2110,9 +2110,6 @@ int spider_parse_connect_info(
|
|||||||
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
|
||||||
@@ -2242,9 +2239,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);
|
||||||
SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0);
|
SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0);
|
||||||
SPIDER_PARAM_INT("bmd", bgs_mode, 0);
|
SPIDER_PARAM_INT("bmd", bgs_mode, 0);
|
||||||
@@ -2497,10 +2491,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 = connect_string_parse.print_param_error();
|
error_num = connect_string_parse.print_param_error();
|
||||||
@@ -3971,10 +3961,6 @@ int spider_set_connect_info_default(
|
|||||||
share->error_write_mode = 0;
|
share->error_write_mode = 0;
|
||||||
if (share->active_link_count == -1)
|
if (share->active_link_count == -1)
|
||||||
share->active_link_count = share->all_link_count;
|
share->active_link_count = share->all_link_count;
|
||||||
#ifdef HA_CAN_BULK_ACCESS
|
|
||||||
if (share->bulk_access_free == -1)
|
|
||||||
share->bulk_access_free = 0;
|
|
||||||
#endif
|
|
||||||
#ifdef HA_CAN_FORCE_BULK_UPDATE
|
#ifdef HA_CAN_FORCE_BULK_UPDATE
|
||||||
if (share->force_bulk_update == -1)
|
if (share->force_bulk_update == -1)
|
||||||
share->force_bulk_update = 0;
|
share->force_bulk_update = 0;
|
||||||
@@ -8327,18 +8313,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;
|
||||||
@@ -8553,12 +8531,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()));
|
||||||
|
@@ -3255,11 +3255,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
|
|
||||||
|
|
||||||
if (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
if (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
||||||
{
|
{
|
||||||
@@ -3347,11 +3342,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
|
|
||||||
|
|
||||||
if (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
if (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
||||||
{
|
{
|
||||||
@@ -4066,34 +4056,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
|
|
||||||
|
@@ -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
|
|
||||||
|
Reference in New Issue
Block a user