Commit ed99f0dd 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 81e60f1a
This diff is collapsed.
......@@ -3238,11 +3238,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,
......@@ -3261,11 +3256,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.
......@@ -1665,9 +1665,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,
......
......@@ -13976,14 +13976,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,
......
......@@ -1487,9 +1487,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,
......
......@@ -1412,30 +1412,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