Commit d8e9f3d9 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-31673 MDEV-29502 Remove spider_db_handler::need_lock_before_set_sql_for_exec

This function trivially returns false
parent 1407f999
This diff is collapsed.
......@@ -2636,11 +2636,6 @@ void *spider_bg_conn_action(
}
#endif
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
if (dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
{
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
if (spider->use_fields)
{
if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
......@@ -2659,11 +2654,8 @@ void *spider_bg_conn_action(
strmov(result_list->bgs_error_msg, spider_stmt_da_message(thd));
}
}
if (!dbton_handler->need_lock_before_set_sql_for_exec(sql_type))
{
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
#ifdef HA_CAN_BULK_ACCESS
......
This diff is collapsed.
......@@ -1633,9 +1633,6 @@ class spider_db_handler
SPIDER_HS_STRING_REF &info
) = 0;
#endif
virtual bool need_lock_before_set_sql_for_exec(
ulong sql_type
) = 0;
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
virtual int set_sql_for_exec(
ulong sql_type,
......
......@@ -13538,14 +13538,6 @@ int spider_mbase_handler::push_back_upds(
}
#endif
bool spider_mbase_handler::need_lock_before_set_sql_for_exec(
ulong sql_type
) {
DBUG_ENTER("spider_mbase_handler::need_lock_before_set_sql_for_exec");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_RETURN(FALSE);
}
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
int spider_mbase_handler::set_sql_for_exec(
ulong sql_type,
......
......@@ -1476,9 +1476,6 @@ class spider_mbase_handler: public spider_db_handler
SPIDER_HS_STRING_REF &info
);
#endif
bool need_lock_before_set_sql_for_exec(
ulong sql_type
);
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
int set_sql_for_exec(
ulong sql_type,
......
......@@ -1411,30 +1411,14 @@ int spider_group_by_handler::init_scan()
} else {
#endif
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
if (dbton_hdl->need_lock_before_set_sql_for_exec(
SPIDER_SQL_TYPE_SELECT_SQL))
{
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
if ((error_num =
dbton_hdl->set_sql_for_exec(SPIDER_SQL_TYPE_SELECT_SQL, link_idx,
link_idx_chain)))
{
if (dbton_hdl->need_lock_before_set_sql_for_exec(
SPIDER_SQL_TYPE_SELECT_SQL))
{
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
DBUG_RETURN(error_num);
}
if (!dbton_hdl->need_lock_before_set_sql_for_exec(
SPIDER_SQL_TYPE_SELECT_SQL))
{
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
conn->need_mon = &spider->need_mons[link_idx];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
......
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