MDEV-27652 remove #ifdef HA_HAS_CHECKSUM_EXTENDED

handler::pre_calculate_checksum was added in MDEV-16249
be5c432a42
This commit is contained in:
Yuchen Pei 2024-06-19 13:47:18 +08:00
parent e8a5553cef
commit 6287fb6e17
No known key found for this signature in database
GPG key ID: 3DD1B35105743563
10 changed files with 0 additions and 48 deletions

View file

@ -8658,7 +8658,6 @@ ha_rows ha_spider::records()
DBUG_RETURN(table_rows);
}
#ifdef HA_HAS_CHECKSUM_EXTENDED
int ha_spider::pre_calculate_checksum()
{
int error_num;
@ -8736,7 +8735,6 @@ int ha_spider::calculate_checksum()
}
DBUG_RETURN(0);
}
#endif
const char *ha_spider::table_type() const
{

View file

@ -179,11 +179,9 @@ public:
SPIDER_ITEM_HLD *direct_aggregate_item_current;
#endif
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;
@ -430,10 +428,8 @@ public:
int check_crd();
int pre_records() override;
ha_rows records() override;
#ifdef HA_HAS_CHECKSUM_EXTENDED
int pre_calculate_checksum() override;
int calculate_checksum() override;
#endif
const char *table_type() const;
ulonglong table_flags() const override;
ulong table_flags_for_partition();

View file

@ -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
/*
The SPIDER_CONN_LOOP_CHECK has been added to the loop_check queue to

View file

@ -5933,14 +5933,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;

View file

@ -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()
{
@ -137,7 +135,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");
@ -152,7 +149,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,

View file

@ -874,11 +874,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,
@ -1119,9 +1117,7 @@ public:
spider_string *str
) = 0;
#endif
#ifdef HA_HAS_CHECKSUM_EXTENDED
virtual bool checksum_support();
#endif
};
class spider_db_handler
@ -1463,11 +1459,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

View file

@ -161,11 +161,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)
@ -1119,7 +1117,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;
@ -1136,7 +1133,6 @@ int spider_db_mbase_result::fetch_simple_action(
}
break;
}
#endif
default:
DBUG_ASSERT(0);
break;
@ -1160,7 +1156,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
) {
@ -1169,7 +1164,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,
@ -8191,14 +8185,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,
@ -14239,7 +14231,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];
@ -14269,7 +14260,6 @@ int spider_mbase_handler::simple_action(
SPIDER_SQL_SQL_EXTENDED_LEN);
}
break;
#endif
default:
DBUG_ASSERT(0);
DBUG_RETURN(0);
@ -14393,12 +14383,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;
@ -14427,7 +14415,6 @@ int spider_mbase_handler::show_records(
DBUG_RETURN(0);
}
#ifdef HA_HAS_CHECKSUM_EXTENDED
int spider_mbase_handler::checksum_table(
int link_idx
) {
@ -14435,7 +14422,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,

View file

@ -318,11 +318,9 @@ public:
int mode,
ha_rows &records
) override;
#ifdef HA_HAS_CHECKSUM_EXTENDED
int fetch_table_checksum(
ha_spider *spider
) override;
#endif
int fetch_table_cardinality(
int mode,
TABLE *table,
@ -669,9 +667,7 @@ public:
spider_string *str
) override;
#endif
#ifdef HA_HAS_CHECKSUM_EXTENDED
bool checksum_support() override;
#endif
protected:
int create_table_names_str();
void free_table_names_str();
@ -1402,11 +1398,9 @@ public:
int show_records(
int link_idx
) override;
#ifdef HA_HAS_CHECKSUM_EXTENDED
int checksum_table(
int link_idx
) override;
#endif
int show_last_insert_id(
int link_idx,
ulonglong &last_insert_id

View file

@ -24,7 +24,5 @@
#define HANDLER_HAS_DIRECT_AGGREGATE
#define HA_HAS_CHECKSUM_EXTENDED
#define SPIDER_I_S_USE_SHOW_FOR_COLUMN
#endif /* SPD_ENVIRON_INCLUDED */

View file

@ -4036,9 +4036,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);
@ -4175,24 +4173,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);
/*