Commit 1b568fb9 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-33539 spider: remove some unused code in self reference checks

parent d37c51b8
......@@ -378,7 +378,6 @@ int spider_db_conn_queue_action(
) ||
(
conn->loop_check_queue.records &&
conn->db_conn->set_loop_check_in_bulk_sql() &&
(error_num = spider_dbton[conn->dbton_id].db_util->
append_loop_check(&sql_str, conn))
) ||
......@@ -477,13 +476,6 @@ int spider_db_conn_queue_action(
) {
DBUG_RETURN(error_num);
}
if (
conn->loop_check_queue.records &&
!conn->db_conn->set_loop_check_in_bulk_sql() &&
(error_num = conn->db_conn->set_loop_check((int *) conn->need_mon))
) {
DBUG_RETURN(error_num);
}
if (
conn->queued_trx_isolation &&
!conn->queued_semi_trx_isolation &&
......
......@@ -71,22 +71,6 @@ spider_db_conn::spider_db_conn(
DBUG_VOID_RETURN;
}
bool spider_db_conn::set_loop_check_in_bulk_sql()
{
DBUG_ENTER("spider_db_conn::set_loop_check_in_bulk_sql");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_RETURN(FALSE);
}
int spider_db_conn::set_loop_check(
int *need_mon
) {
DBUG_ENTER("spider_db_conn::set_loop_check");
DBUG_PRINT("info",("spider this=%p", this));
/* nothing to do */
DBUG_RETURN(0);
}
int spider_db_conn::fin_loop_check()
{
st_spider_conn_loop_check *lcptr;
......
......@@ -1170,10 +1170,6 @@ class spider_db_conn
Time_zone *time_zone,
int *need_mon
) = 0;
virtual bool set_loop_check_in_bulk_sql();
virtual int set_loop_check(
int *need_mon
);
virtual int fin_loop_check();
virtual int show_master_status(
SPIDER_TRX *trx,
......
......@@ -3352,115 +3352,6 @@ int spider_db_mbase::set_time_zone(
DBUG_RETURN(0);
}
bool spider_db_mbase::set_loop_check_in_bulk_sql()
{
DBUG_ENTER("spider_db_mbase::set_loop_check_in_bulk_sql");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_RETURN(TRUE);
}
int spider_db_mbase::set_loop_check(
int *need_mon
) {
SPIDER_CONN_LOOP_CHECK *lcptr;
char sql_buf[MAX_FIELD_WIDTH];
spider_string sql_str(sql_buf, sizeof(sql_buf), &my_charset_bin);
DBUG_ENTER("spider_db_mbase::set_loop_check");
DBUG_PRINT("info",("spider this=%p", this));
sql_str.init_calc_mem(SPD_MID_DB_MBASE_SET_LOOP_CHECK_1);
while ((lcptr = (SPIDER_CONN_LOOP_CHECK *) my_hash_element(
&conn->loop_check_queue, 0)))
{
sql_str.length(0);
if (sql_str.reserve(SPIDER_SQL_SET_USER_VAL_LEN +
SPIDER_SQL_LOP_CHK_PRM_PRF_LEN + lcptr->to_name.length +
SPIDER_SQL_NAME_QUOTE_LEN + SPIDER_SQL_EQUAL_LEN +
SPIDER_SQL_VALUE_QUOTE_LEN +
lcptr->merged_value.length + SPIDER_SQL_VALUE_QUOTE_LEN))
{
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
sql_str.q_append(SPIDER_SQL_SET_USER_VAL_STR, SPIDER_SQL_SET_USER_VAL_LEN);
sql_str.q_append(SPIDER_SQL_LOP_CHK_PRM_PRF_STR,
SPIDER_SQL_LOP_CHK_PRM_PRF_LEN);
sql_str.q_append(lcptr->to_name.str, lcptr->to_name.length);
sql_str.q_append(SPIDER_SQL_NAME_QUOTE_STR, SPIDER_SQL_NAME_QUOTE_LEN);
sql_str.q_append(SPIDER_SQL_EQUAL_STR, SPIDER_SQL_EQUAL_LEN);
sql_str.q_append(SPIDER_SQL_VALUE_QUOTE_STR, SPIDER_SQL_VALUE_QUOTE_LEN);
sql_str.q_append(lcptr->merged_value.str, lcptr->merged_value.length);
sql_str.q_append(SPIDER_SQL_VALUE_QUOTE_STR, SPIDER_SQL_VALUE_QUOTE_LEN);
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 = need_mon;
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 (spider_db_query(
conn,
sql_str.ptr(),
sql_str.length(),
-1,
need_mon)
) {
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;
DBUG_RETURN(spider_db_errorno(conn));
}
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);
#ifdef HASH_UPDATE_WITH_HASH_VALUE
my_hash_delete_with_hash_value(&conn->loop_check_queue,
lcptr->hash_value, (uchar *) lcptr);
#else
my_hash_delete(&conn->loop_check_queue, (uchar*) lcptr);
#endif
}
DBUG_RETURN(0);
}
int spider_db_mbase::fin_loop_check()
{
st_spider_conn_loop_check *lcptr;
DBUG_ENTER("spider_db_mbase::fin_loop_check");
DBUG_PRINT("info",("spider this=%p", this));
if (conn->loop_check_queue.records)
{
uint l = 0;
while ((lcptr = (SPIDER_CONN_LOOP_CHECK *) my_hash_element(
&conn->loop_check_queue, l)))
{
lcptr->flag = 0;
++l;
}
my_hash_reset(&conn->loop_check_queue);
}
lcptr = conn->loop_check_ignored_first;
while (lcptr)
{
lcptr->flag = 0;
lcptr = lcptr->next;
}
conn->loop_check_ignored_first = NULL;
lcptr = conn->loop_check_meraged_first;
while (lcptr)
{
lcptr->flag = 0;
lcptr = lcptr->next;
}
conn->loop_check_meraged_first = NULL;
DBUG_RETURN(0);
}
int spider_db_mbase::exec_simple_sql_with_result(
SPIDER_TRX *trx,
SPIDER_SHARE *share,
......
......@@ -527,11 +527,6 @@ class spider_db_mbase: public spider_db_conn
Time_zone *time_zone,
int *need_mon
);
bool set_loop_check_in_bulk_sql();
int set_loop_check(
int *need_mon
);
int fin_loop_check();
int exec_simple_sql_with_result(
SPIDER_TRX *trx,
SPIDER_SHARE *share,
......
......@@ -377,7 +377,6 @@ enum spider_malloc_id {
SPD_MID_DB_MBASE_RESULT_FETCH_ROW_FROM_TMP_TABLE_3,
SPD_MID_DB_MBASE_ROW_APPEND_ESCAPED_TO_STR_1,
SPD_MID_DB_MBASE_ROW_CLONE_1,
SPD_MID_DB_MBASE_SET_LOOP_CHECK_1,
SPD_MID_DB_MBASE_SET_SQL_MODE_1,
SPD_MID_DB_MBASE_SET_TIME_ZONE_1,
SPD_MID_DB_MBASE_SET_WAIT_TIMEOUT_1,
......
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