From cf577bab6f57895734ef3ffc530d41d0189bccc6 Mon Sep 17 00:00:00 2001 From: Nayuta Yanagisawa Date: Fri, 28 Jan 2022 16:09:48 +0900 Subject: [PATCH] MDEV-27652 Spider: remove dead code in #ifdef HA_HAS_CHECKSUM_EXTENDED --- storage/spider/ha_spider.cc | 2 -- storage/spider/ha_spider.h | 4 ---- storage/spider/spd_conn.h | 2 -- storage/spider/spd_db_conn.cc | 2 -- storage/spider/spd_db_include.cc | 4 ---- storage/spider/spd_db_include.h | 6 ------ storage/spider/spd_db_mysql.cc | 14 -------------- storage/spider/spd_db_mysql.h | 6 ------ storage/spider/spd_table.cc | 6 ------ 9 files changed, 46 deletions(-) diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index cbc68c14cd7..9942d95ac29 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -7833,7 +7833,6 @@ ha_rows ha_spider::records() DBUG_RETURN(table_rows); } -#ifdef HA_HAS_CHECKSUM_EXTENDED int ha_spider::pre_calculate_checksum() { int error_num; @@ -7911,7 +7910,6 @@ int ha_spider::calculate_checksum() } DBUG_RETURN(0); } -#endif const char *ha_spider::table_type() const { diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h index 1cf36890807..70b5c869130 100644 --- a/storage/spider/ha_spider.h +++ b/storage/spider/ha_spider.h @@ -151,11 +151,9 @@ public: SPIDER_ITEM_HLD *direct_aggregate_item_first; SPIDER_ITEM_HLD *direct_aggregate_item_current; ha_rows table_rows; -#ifdef HA_HAS_CHECKSUM_EXTENDED ha_checksum checksum_val; bool checksum_null; uint action_flags; -#endif /* for fulltext search */ bool ft_init_and_first; @@ -355,10 +353,8 @@ public: int check_crd(); int pre_records(); ha_rows records(); -#ifdef HA_HAS_CHECKSUM_EXTENDED int pre_calculate_checksum(); int calculate_checksum(); -#endif const char *table_type() const; ulonglong table_flags() const; ulong table_flags_for_partition(); diff --git a/storage/spider/spd_conn.h b/storage/spider/spd_conn.h index 44c225a2216..53c10572687 100644 --- a/storage/spider/spd_conn.h +++ b/storage/spider/spd_conn.h @@ -22,9 +22,7 @@ #define SPIDER_SIMPLE_CONNECT 1 #define SPIDER_SIMPLE_DISCONNECT 2 #define SPIDER_SIMPLE_RECORDS 3 -#ifdef HA_HAS_CHECKSUM_EXTENDED #define SPIDER_SIMPLE_CHECKSUM_TABLE 4 -#endif #define SPIDER_LOP_CHK_QUEUED (1 << 0) #define SPIDER_LOP_CHK_MERAGED (1 << 1) diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index 47488384d4b..6ed9805a5ca 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -5864,14 +5864,12 @@ int spider_db_simple_action( link_idx ); break; -#ifdef HA_HAS_CHECKSUM_EXTENDED case SPIDER_SIMPLE_CHECKSUM_TABLE: DBUG_PRINT("info",("spider simple checksum_table")); error_num = db_handler->checksum_table( link_idx ); break; -#endif default: DBUG_ASSERT(0); error_num = HA_ERR_CRASHED; diff --git a/storage/spider/spd_db_include.cc b/storage/spider/spd_db_include.cc index 944688ea3bd..963fdd80621 100644 --- a/storage/spider/spd_db_include.cc +++ b/storage/spider/spd_db_include.cc @@ -40,7 +40,6 @@ spider_db_result::spider_db_result( DBUG_VOID_RETURN; } -#ifdef HA_HAS_CHECKSUM_EXTENDED int spider_db_result::fetch_table_checksum( ha_spider *spider ) { @@ -48,7 +47,6 @@ int spider_db_result::fetch_table_checksum( DBUG_PRINT("info",("spider this=%p", this)); DBUG_RETURN(0); } -#endif uint spider_db_result::limit_mode() { @@ -188,7 +186,6 @@ uint spider_db_util::limit_mode() DBUG_RETURN(0); } -#ifdef HA_HAS_CHECKSUM_EXTENDED bool spider_db_share::checksum_support() { DBUG_ENTER("spider_db_share::checksum_support"); @@ -203,7 +200,6 @@ int spider_db_handler::checksum_table( DBUG_PRINT("info",("spider this=%p", this)); DBUG_RETURN(0); } -#endif bool spider_db_handler::check_direct_update( st_select_lex *select_lex, diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h index a7003a437f2..088acc7e794 100644 --- a/storage/spider/spd_db_include.h +++ b/storage/spider/spd_db_include.h @@ -905,11 +905,9 @@ public: int mode, ha_rows &records ) = 0; -#ifdef HA_HAS_CHECKSUM_EXTENDED virtual int fetch_table_checksum( ha_spider *spider ); -#endif virtual int fetch_table_cardinality( int mode, TABLE *table, @@ -1154,9 +1152,7 @@ public: spider_string *str ) = 0; #endif -#ifdef HA_HAS_CHECKSUM_EXTENDED virtual bool checksum_support(); -#endif }; class spider_db_handler @@ -1495,11 +1491,9 @@ public: virtual int show_records( int link_idx ) = 0; -#ifdef HA_HAS_CHECKSUM_EXTENDED virtual int checksum_table( int link_idx ); -#endif virtual int show_last_insert_id( int link_idx, ulonglong &last_insert_id diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index bdf96e2850a..1008d0b8ddd 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -159,11 +159,9 @@ static const char *name_quote_str = SPIDER_SQL_NAME_QUOTE_STR; #define SPIDER_SQL_SHOW_RECORDS_RECORDS_POS 0 #define SPIDER_SQL_EXPLAIN_SELECT_RECORDS_POS 8 -#ifdef HA_HAS_CHECKSUM_EXTENDED #define SPIDER_SQL_CHECKSUM_CHECKSUM_POS 1 #define SPIDER_SQL_CHECKSUM_TABLE_STR "checksum table " #define SPIDER_SQL_CHECKSUM_TABLE_LEN (sizeof(SPIDER_SQL_CHECKSUM_TABLE_STR) - 1) -#endif #define SPIDER_SQL_LIKE_STR " like " #define SPIDER_SQL_LIKE_LEN (sizeof(SPIDER_SQL_LIKE_STR) - 1) @@ -1148,7 +1146,6 @@ int spider_db_mbase_result::fetch_simple_action( DBUG_PRINT("info", ("spider records=%lld", *records)); break; } -#ifdef HA_HAS_CHECKSUM_EXTENDED case SPIDER_SIMPLE_CHECKSUM_TABLE: { ha_spider *spider = (ha_spider *) param; @@ -1165,7 +1162,6 @@ int spider_db_mbase_result::fetch_simple_action( } break; } -#endif default: DBUG_ASSERT(0); break; @@ -1189,7 +1185,6 @@ int spider_db_mbase_result::fetch_table_records( } } -#ifdef HA_HAS_CHECKSUM_EXTENDED int spider_db_mbase_result::fetch_table_checksum( ha_spider *spider ) { @@ -1198,7 +1193,6 @@ int spider_db_mbase_result::fetch_table_checksum( DBUG_RETURN(fetch_simple_action(SPIDER_SIMPLE_CHECKSUM_TABLE, SPIDER_SQL_CHECKSUM_CHECKSUM_POS, spider)); } -#endif int spider_db_mbase_result::fetch_table_cardinality( int mode, @@ -8724,14 +8718,12 @@ int spider_mbase_share::discover_table_structure( } #endif -#ifdef HA_HAS_CHECKSUM_EXTENDED bool spider_mbase_share::checksum_support() { DBUG_ENTER("spider_mbase_share::checksum_support"); DBUG_PRINT("info",("spider this=%p", this)); DBUG_RETURN(TRUE); } -#endif spider_mbase_handler::spider_mbase_handler( ha_spider *spider, @@ -14791,7 +14783,6 @@ int spider_mbase_handler::simple_action( DBUG_PRINT("info",("spider simple records")); str = &mysql_share->show_records[pos]; break; -#ifdef HA_HAS_CHECKSUM_EXTENDED case SPIDER_SIMPLE_CHECKSUM_TABLE: DBUG_PRINT("info",("spider simple checksum_table")); str = &spider->result_list.sqls[link_idx]; @@ -14821,7 +14812,6 @@ int spider_mbase_handler::simple_action( SPIDER_SQL_SQL_EXTENDED_LEN); } break; -#endif default: DBUG_ASSERT(0); DBUG_RETURN(0); @@ -14945,12 +14935,10 @@ int spider_mbase_handler::simple_action( DBUG_PRINT("info",("spider simple records")); error_num = res->fetch_table_records(1, spider->table_rows); break; -#ifdef HA_HAS_CHECKSUM_EXTENDED case SPIDER_SIMPLE_CHECKSUM_TABLE: DBUG_PRINT("info",("spider simple checksum_table")); error_num = res->fetch_table_checksum(spider); break; -#endif default: DBUG_ASSERT(0); break; @@ -14980,7 +14968,6 @@ int spider_mbase_handler::show_records( DBUG_RETURN(0); } -#ifdef HA_HAS_CHECKSUM_EXTENDED int spider_mbase_handler::checksum_table( int link_idx ) { @@ -14988,7 +14975,6 @@ int spider_mbase_handler::checksum_table( DBUG_RETURN(simple_action(SPIDER_SIMPLE_CHECKSUM_TABLE, link_idx)); DBUG_RETURN(0); } -#endif int spider_mbase_handler::show_last_insert_id( int link_idx, diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index 35655600840..ba6feaa2dfd 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -326,11 +326,9 @@ public: int mode, ha_rows &records ); -#ifdef HA_HAS_CHECKSUM_EXTENDED int fetch_table_checksum( ha_spider *spider ); -#endif int fetch_table_cardinality( int mode, TABLE *table, @@ -681,9 +679,7 @@ public: spider_string *str ); #endif -#ifdef HA_HAS_CHECKSUM_EXTENDED bool checksum_support(); -#endif protected: int create_table_names_str(); void free_table_names_str(); @@ -1435,11 +1431,9 @@ public: int show_records( int link_idx ); -#ifdef HA_HAS_CHECKSUM_EXTENDED int checksum_table( int link_idx ); -#endif int show_last_insert_id( int link_idx, ulonglong &last_insert_id diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index d583fa411ac..aa48152f032 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -4395,9 +4395,7 @@ SPIDER_SHARE *spider_create_share( uchar *tmp_cardinality_upd, *tmp_table_mon_mutex_bitmap; char buf[MAX_FIELD_WIDTH], *buf_pos; char link_idx_str[SPIDER_SQL_INT_LEN]; -#ifdef HA_HAS_CHECKSUM_EXTENDED bool checksum_support = TRUE; -#endif DBUG_ENTER("spider_create_share"); length = (uint) strlen(table_name); bitmap_size = spider_bitmap_size(table_share->fields); @@ -4532,24 +4530,20 @@ SPIDER_SHARE *spider_create_share( { goto error_init_dbton; } -#ifdef HA_HAS_CHECKSUM_EXTENDED if ( spider_dbton[roop_count].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL && !share->dbton_share[roop_count]->checksum_support() ) { checksum_support = FALSE; } -#endif } } -#ifdef HA_HAS_CHECKSUM_EXTENDED if (checksum_support) { share->additional_table_flags |= HA_HAS_OLD_CHECKSUM | HA_HAS_NEW_CHECKSUM; } -#endif DBUG_RETURN(share); /*