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( ...@@ -2518,11 +2518,6 @@ void *spider_bg_conn_action(
ulong sql_type; ulong sql_type;
sql_type= SPIDER_SQL_TYPE_SELECT_SQL | SPIDER_SQL_TYPE_TMP_SQL; sql_type= SPIDER_SQL_TYPE_SELECT_SQL | SPIDER_SQL_TYPE_TMP_SQL;
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); 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 (spider->use_fields)
{ {
if ((error_num = dbton_handler->set_sql_for_exec(sql_type, if ((error_num = dbton_handler->set_sql_for_exec(sql_type,
...@@ -2541,11 +2536,8 @@ void *spider_bg_conn_action( ...@@ -2541,11 +2536,8 @@ void *spider_bg_conn_action(
strmov(result_list->bgs_error_msg, spider_stmt_da_message(thd)); 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; 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));
if (!result_list->bgs_error) if (!result_list->bgs_error)
......
This diff is collapsed.
...@@ -1432,9 +1432,6 @@ class spider_db_handler ...@@ -1432,9 +1432,6 @@ class spider_db_handler
virtual int reset_sql( virtual int reset_sql(
ulong sql_type ulong sql_type
) = 0; ) = 0;
virtual bool need_lock_before_set_sql_for_exec(
ulong sql_type
) = 0;
virtual int set_sql_for_exec( virtual int set_sql_for_exec(
ulong sql_type, ulong sql_type,
int link_idx, int link_idx,
......
...@@ -13205,14 +13205,6 @@ int spider_mbase_handler::reset_sql( ...@@ -13205,14 +13205,6 @@ int spider_mbase_handler::reset_sql(
DBUG_RETURN(0); 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( int spider_mbase_handler::set_sql_for_exec(
ulong sql_type, ulong sql_type,
int link_idx, int link_idx,
......
...@@ -1373,9 +1373,6 @@ class spider_mbase_handler: public spider_db_handler ...@@ -1373,9 +1373,6 @@ class spider_mbase_handler: public spider_db_handler
int reset_sql( int reset_sql(
ulong sql_type ulong sql_type
); );
bool need_lock_before_set_sql_for_exec(
ulong sql_type
);
int set_sql_for_exec( int set_sql_for_exec(
ulong sql_type, ulong sql_type,
int link_idx, int link_idx,
......
...@@ -1394,30 +1394,14 @@ int spider_group_by_handler::init_scan() ...@@ -1394,30 +1394,14 @@ int spider_group_by_handler::init_scan()
} }
} else { } else {
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); 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 = if ((error_num =
dbton_hdl->set_sql_for_exec(SPIDER_SQL_TYPE_SELECT_SQL, link_idx, dbton_hdl->set_sql_for_exec(SPIDER_SQL_TYPE_SELECT_SQL, link_idx,
link_idx_chain))) 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); DBUG_RETURN(error_num);
} }
if (!dbton_hdl->need_lock_before_set_sql_for_exec( pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SQL_TYPE_SELECT_SQL)) 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]; conn->need_mon = &spider->need_mons[link_idx];
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);
......
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