Skip to content

Commit 1b568fb

Browse files
MDEV-33539 spider: remove some unused code in self reference checks
1 parent d37c51b commit 1b568fb

File tree

6 files changed

+0
-143
lines changed

6 files changed

+0
-143
lines changed

storage/spider/spd_db_conn.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ int spider_db_conn_queue_action(
378378
) ||
379379
(
380380
conn->loop_check_queue.records &&
381-
conn->db_conn->set_loop_check_in_bulk_sql() &&
382381
(error_num = spider_dbton[conn->dbton_id].db_util->
383382
append_loop_check(&sql_str, conn))
384383
) ||
@@ -477,13 +476,6 @@ int spider_db_conn_queue_action(
477476
) {
478477
DBUG_RETURN(error_num);
479478
}
480-
if (
481-
conn->loop_check_queue.records &&
482-
!conn->db_conn->set_loop_check_in_bulk_sql() &&
483-
(error_num = conn->db_conn->set_loop_check((int *) conn->need_mon))
484-
) {
485-
DBUG_RETURN(error_num);
486-
}
487479
if (
488480
conn->queued_trx_isolation &&
489481
!conn->queued_semi_trx_isolation &&

storage/spider/spd_db_include.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,6 @@ spider_db_conn::spider_db_conn(
7171
DBUG_VOID_RETURN;
7272
}
7373

74-
bool spider_db_conn::set_loop_check_in_bulk_sql()
75-
{
76-
DBUG_ENTER("spider_db_conn::set_loop_check_in_bulk_sql");
77-
DBUG_PRINT("info",("spider this=%p", this));
78-
DBUG_RETURN(FALSE);
79-
}
80-
81-
int spider_db_conn::set_loop_check(
82-
int *need_mon
83-
) {
84-
DBUG_ENTER("spider_db_conn::set_loop_check");
85-
DBUG_PRINT("info",("spider this=%p", this));
86-
/* nothing to do */
87-
DBUG_RETURN(0);
88-
}
89-
9074
int spider_db_conn::fin_loop_check()
9175
{
9276
st_spider_conn_loop_check *lcptr;

storage/spider/spd_db_include.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,10 +1170,6 @@ class spider_db_conn
11701170
Time_zone *time_zone,
11711171
int *need_mon
11721172
) = 0;
1173-
virtual bool set_loop_check_in_bulk_sql();
1174-
virtual int set_loop_check(
1175-
int *need_mon
1176-
);
11771173
virtual int fin_loop_check();
11781174
virtual int show_master_status(
11791175
SPIDER_TRX *trx,

storage/spider/spd_db_mysql.cc

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,115 +3352,6 @@ int spider_db_mbase::set_time_zone(
33523352
DBUG_RETURN(0);
33533353
}
33543354

3355-
bool spider_db_mbase::set_loop_check_in_bulk_sql()
3356-
{
3357-
DBUG_ENTER("spider_db_mbase::set_loop_check_in_bulk_sql");
3358-
DBUG_PRINT("info",("spider this=%p", this));
3359-
DBUG_RETURN(TRUE);
3360-
}
3361-
3362-
int spider_db_mbase::set_loop_check(
3363-
int *need_mon
3364-
) {
3365-
SPIDER_CONN_LOOP_CHECK *lcptr;
3366-
char sql_buf[MAX_FIELD_WIDTH];
3367-
spider_string sql_str(sql_buf, sizeof(sql_buf), &my_charset_bin);
3368-
DBUG_ENTER("spider_db_mbase::set_loop_check");
3369-
DBUG_PRINT("info",("spider this=%p", this));
3370-
sql_str.init_calc_mem(SPD_MID_DB_MBASE_SET_LOOP_CHECK_1);
3371-
while ((lcptr = (SPIDER_CONN_LOOP_CHECK *) my_hash_element(
3372-
&conn->loop_check_queue, 0)))
3373-
{
3374-
sql_str.length(0);
3375-
if (sql_str.reserve(SPIDER_SQL_SET_USER_VAL_LEN +
3376-
SPIDER_SQL_LOP_CHK_PRM_PRF_LEN + lcptr->to_name.length +
3377-
SPIDER_SQL_NAME_QUOTE_LEN + SPIDER_SQL_EQUAL_LEN +
3378-
SPIDER_SQL_VALUE_QUOTE_LEN +
3379-
lcptr->merged_value.length + SPIDER_SQL_VALUE_QUOTE_LEN))
3380-
{
3381-
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
3382-
}
3383-
sql_str.q_append(SPIDER_SQL_SET_USER_VAL_STR, SPIDER_SQL_SET_USER_VAL_LEN);
3384-
sql_str.q_append(SPIDER_SQL_LOP_CHK_PRM_PRF_STR,
3385-
SPIDER_SQL_LOP_CHK_PRM_PRF_LEN);
3386-
sql_str.q_append(lcptr->to_name.str, lcptr->to_name.length);
3387-
sql_str.q_append(SPIDER_SQL_NAME_QUOTE_STR, SPIDER_SQL_NAME_QUOTE_LEN);
3388-
sql_str.q_append(SPIDER_SQL_EQUAL_STR, SPIDER_SQL_EQUAL_LEN);
3389-
sql_str.q_append(SPIDER_SQL_VALUE_QUOTE_STR, SPIDER_SQL_VALUE_QUOTE_LEN);
3390-
sql_str.q_append(lcptr->merged_value.str, lcptr->merged_value.length);
3391-
sql_str.q_append(SPIDER_SQL_VALUE_QUOTE_STR, SPIDER_SQL_VALUE_QUOTE_LEN);
3392-
3393-
pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
3394-
pthread_mutex_lock(&conn->mta_conn_mutex);
3395-
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
3396-
conn->need_mon = need_mon;
3397-
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
3398-
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
3399-
conn->mta_conn_mutex_lock_already = TRUE;
3400-
conn->mta_conn_mutex_unlock_later = TRUE;
3401-
if (spider_db_query(
3402-
conn,
3403-
sql_str.ptr(),
3404-
sql_str.length(),
3405-
-1,
3406-
need_mon)
3407-
) {
3408-
DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
3409-
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
3410-
conn->mta_conn_mutex_lock_already = FALSE;
3411-
conn->mta_conn_mutex_unlock_later = FALSE;
3412-
DBUG_RETURN(spider_db_errorno(conn));
3413-
}
3414-
DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
3415-
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
3416-
conn->mta_conn_mutex_lock_already = FALSE;
3417-
conn->mta_conn_mutex_unlock_later = FALSE;
3418-
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
3419-
pthread_mutex_unlock(&conn->mta_conn_mutex);
3420-
3421-
#ifdef HASH_UPDATE_WITH_HASH_VALUE
3422-
my_hash_delete_with_hash_value(&conn->loop_check_queue,
3423-
lcptr->hash_value, (uchar *) lcptr);
3424-
#else
3425-
my_hash_delete(&conn->loop_check_queue, (uchar*) lcptr);
3426-
#endif
3427-
}
3428-
DBUG_RETURN(0);
3429-
}
3430-
3431-
int spider_db_mbase::fin_loop_check()
3432-
{
3433-
st_spider_conn_loop_check *lcptr;
3434-
DBUG_ENTER("spider_db_mbase::fin_loop_check");
3435-
DBUG_PRINT("info",("spider this=%p", this));
3436-
if (conn->loop_check_queue.records)
3437-
{
3438-
uint l = 0;
3439-
while ((lcptr = (SPIDER_CONN_LOOP_CHECK *) my_hash_element(
3440-
&conn->loop_check_queue, l)))
3441-
{
3442-
lcptr->flag = 0;
3443-
++l;
3444-
}
3445-
my_hash_reset(&conn->loop_check_queue);
3446-
}
3447-
lcptr = conn->loop_check_ignored_first;
3448-
while (lcptr)
3449-
{
3450-
lcptr->flag = 0;
3451-
lcptr = lcptr->next;
3452-
}
3453-
conn->loop_check_ignored_first = NULL;
3454-
lcptr = conn->loop_check_meraged_first;
3455-
while (lcptr)
3456-
{
3457-
lcptr->flag = 0;
3458-
lcptr = lcptr->next;
3459-
}
3460-
conn->loop_check_meraged_first = NULL;
3461-
DBUG_RETURN(0);
3462-
}
3463-
34643355
int spider_db_mbase::exec_simple_sql_with_result(
34653356
SPIDER_TRX *trx,
34663357
SPIDER_SHARE *share,

storage/spider/spd_db_mysql.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,6 @@ class spider_db_mbase: public spider_db_conn
527527
Time_zone *time_zone,
528528
int *need_mon
529529
);
530-
bool set_loop_check_in_bulk_sql();
531-
int set_loop_check(
532-
int *need_mon
533-
);
534-
int fin_loop_check();
535530
int exec_simple_sql_with_result(
536531
SPIDER_TRX *trx,
537532
SPIDER_SHARE *share,

storage/spider/spd_include.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ enum spider_malloc_id {
377377
SPD_MID_DB_MBASE_RESULT_FETCH_ROW_FROM_TMP_TABLE_3,
378378
SPD_MID_DB_MBASE_ROW_APPEND_ESCAPED_TO_STR_1,
379379
SPD_MID_DB_MBASE_ROW_CLONE_1,
380-
SPD_MID_DB_MBASE_SET_LOOP_CHECK_1,
381380
SPD_MID_DB_MBASE_SET_SQL_MODE_1,
382381
SPD_MID_DB_MBASE_SET_TIME_ZONE_1,
383382
SPD_MID_DB_MBASE_SET_WAIT_TIMEOUT_1,

0 commit comments

Comments
 (0)