Commit 906b5065 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 6dfe8d11
This diff is collapsed.
......@@ -2518,11 +2518,6 @@ void *spider_bg_conn_action(
ulong sql_type;
sql_type= SPIDER_SQL_TYPE_SELECT_SQL | SPIDER_SQL_TYPE_TMP_SQL;
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,
......@@ -2541,11 +2536,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));
if (!result_list->bgs_error)
......
This diff is collapsed.
......@@ -1432,9 +1432,6 @@ class spider_db_handler
virtual int reset_sql(
ulong sql_type
) = 0;
virtual bool need_lock_before_set_sql_for_exec(
ulong sql_type
) = 0;
virtual int set_sql_for_exec(
ulong sql_type,
int link_idx,
......
......@@ -13205,14 +13205,6 @@ int spider_mbase_handler::reset_sql(
DBUG_RETURN(0);
}
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);
}
int spider_mbase_handler::set_sql_for_exec(
ulong sql_type,
int link_idx,
......
......@@ -1373,9 +1373,6 @@ class spider_mbase_handler: public spider_db_handler
int reset_sql(
ulong sql_type
);
bool need_lock_before_set_sql_for_exec(
ulong sql_type
);
int set_sql_for_exec(
ulong sql_type,
int link_idx,
......
......@@ -1394,30 +1394,14 @@ int spider_group_by_handler::init_scan()
}
} else {
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