Skip to content

Commit 33f8f92

Browse files
committed
MDEV-30695 Refactor case folding data types in Asian collations
This is a non-functional change and should not change the server behavior. Casefolding information is now stored in items of a new data type MY_CASEFOLD_CHARACTER: typedef struct casefold_info_char_t { uint32 toupper; uint32 tolower; } MY_CASEFOLD_CHARACTER; Before this change, casefolding tables for Asian collations were stored in: typedef struct unicase_info_char_st { uint32 toupper; uint32 tolower; uint32 sort; } MY_UNICASE_CHARACTER; The "sort" member was not used in the code handling Asian collations, it only wasted space. (it's only used by Unicode _general_ci and _general_mysql500_ci collations). Unicode collations (at least UCA and _bin) should also be refactored later, but under terms of a separate task.
1 parent 7e341cc commit 33f8f92

20 files changed

+8185
-7842
lines changed

include/m_ctype.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,26 @@ typedef const struct my_charset_handler_st MY_CHARSET_HANDLER;
8080
typedef const struct my_collation_handler_st MY_COLLATION_HANDLER;
8181

8282
typedef const struct unicase_info_st MY_UNICASE_INFO;
83+
typedef const struct casefold_info_st MY_CASEFOLD_INFO;
8384
typedef const struct uni_ctype_st MY_UNI_CTYPE;
8485
typedef const struct my_uni_idx_st MY_UNI_IDX;
8586
typedef uint16 decimal_digits_t;
8687

88+
89+
typedef struct casefold_info_char_t
90+
{
91+
uint32 toupper;
92+
uint32 tolower;
93+
} MY_CASEFOLD_CHARACTER;
94+
95+
96+
struct casefold_info_st
97+
{
98+
my_wc_t maxchar;
99+
MY_CASEFOLD_CHARACTER **page;
100+
};
101+
102+
87103
typedef struct unicase_info_char_st
88104
{
89105
uint32 toupper;
@@ -755,6 +771,7 @@ struct charset_info_st
755771
MY_UCA_INFO *uca;
756772
const uint16 *tab_to_uni;
757773
MY_UNI_IDX *tab_from_uni;
774+
MY_CASEFOLD_INFO *casefold;
758775
MY_UNICASE_INFO *caseinfo;
759776
const uchar *state_map;
760777
const uchar *ident_map;

strings/conf_to_src.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ void dispcset(FILE *f,CHARSET_INFO *cs)
408408
}
409409

410410
fprintf(f," NULL, /* from_uni */\n");
411+
fprintf(f," NULL, /* casefold */\n");
411412
fprintf(f," &my_unicase_default, /* caseinfo */\n");
412413
fprintf(f," NULL, /* state map */\n");
413414
fprintf(f," NULL, /* ident map */\n");

0 commit comments

Comments
 (0)