From f7a9f446d7467b15b7b4e58cea5dd204cca9762d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 10 Jul 2023 22:25:52 +0200 Subject: [PATCH] cleanup: remove unused keyinfo flag HA_UNIQUE_CHECK was * only used internally by MyISAM/Aria * only used for internal temporary tables (for DISTINCT) * never saved in frm * saved in MYI/MAD but only for temporary tables * only set, never checked it's safe to remove it and free the bit (there are only 16 of them) --- include/my_base.h | 6 ++---- storage/maria/ma_create.c | 1 - storage/myisam/mi_create.c | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index 10daf1c79d1..a9f176abaf2 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -268,17 +268,15 @@ enum ha_base_keytype { #define HA_NOSAME 1U /* Set if not dupplicated records */ #define HA_PACK_KEY 2U /* Pack string key to previous key */ -#define HA_AUTO_KEY 16U +#define HA_AUTO_KEY 16U /* MEMORY/MyISAM/Aria internal */ #define HA_BINARY_PACK_KEY 32U /* Packing of all keys to prev key */ #define HA_FULLTEXT 128U /* For full-text search */ -#define HA_UNIQUE_CHECK 256U /* Check the key for uniqueness */ #define HA_SPATIAL 1024U /* For spatial search */ #define HA_NULL_ARE_EQUAL 2048U /* NULL in key are cmp as equal */ #define HA_GENERATED_KEY 8192U /* Automatically generated key */ /* The combination of the above can be used for key type comparison. */ -#define HA_KEYFLAG_MASK (HA_NOSAME | HA_AUTO_KEY | \ - HA_FULLTEXT | HA_UNIQUE_CHECK | \ +#define HA_KEYFLAG_MASK (HA_NOSAME | HA_AUTO_KEY | HA_FULLTEXT | \ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) /* diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index bbbde63dcd0..abfdc986ce3 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -980,7 +980,6 @@ int maria_create(const char *name, enum data_file_type datafile_type, for (i=0; i < uniques ; i++) { tmp_keydef.keysegs=1; - tmp_keydef.flag= HA_UNIQUE_CHECK; tmp_keydef.block_length= (uint16) maria_block_size; tmp_keydef.keylength= MARIA_UNIQUE_HASH_LENGTH + pointer; tmp_keydef.minlength=tmp_keydef.maxlength=tmp_keydef.keylength; diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 2837354f869..abbdf83bc22 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -754,7 +754,6 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, for (i=0; i < uniques ; i++) { tmp_keydef.keysegs=1; - tmp_keydef.flag= HA_UNIQUE_CHECK; tmp_keydef.block_length= (uint16)myisam_block_size; tmp_keydef.keylength= MI_UNIQUE_HASH_LENGTH + pointer; tmp_keydef.minlength=tmp_keydef.maxlength=tmp_keydef.keylength;