Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
Description
Files ctype-utf8.c and ctype-ucs2.c have very similar pieces of the code:
static inline void |
my_tosort_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
|
{
|
if (*wc <= uni_plane->maxchar) |
{
|
MY_UNICASE_CHARACTER *page;
|
if ((page= uni_plane->page[*wc >> 8])) |
*wc= page[*wc & 0xFF].sort;
|
}
|
else |
{
|
*wc= MY_CS_REPLACEMENT_CHARACTER;
|
}
|
}
|
static inline void |
my_tosort_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
|
{
|
if (*wc <= uni_plane->maxchar) |
{
|
MY_UNICASE_CHARACTER *page;
|
if ((page= uni_plane->page[*wc >> 8])) |
*wc= page[*wc & 0xFF].sort;
|
}
|
else |
{
|
*wc= MY_CS_REPLACEMENT_CHARACTER;
|
}
|
}
|
static inline void |
my_tosort_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc)
|
{
|
MY_UNICASE_CHARACTER *page;
|
if ((page= uni_plane->page[(*wc >> 8) & 0xFF])) |
*wc= page[*wc & 0xFF].sort;
|
}
|
static inline void |
my_tosort_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc, uint flags)
|
{
|
if (*wc <= uni_plane->maxchar) |
{
|
MY_UNICASE_CHARACTER *page;
|
if ((page= uni_plane->page[*wc >> 8])) |
*wc= (flags & MY_CS_LOWER_SORT) ?
|
page[*wc & 0xFF].tolower : |
page[*wc & 0xFF].sort;
|
}
|
else |
{
|
*wc= MY_CS_REPLACEMENT_CHARACTER;
|
}
|
}
|
In order to simplify the patch for MDEV-30577 lets move the repeatable code to a shared file ctype-unidata.h:
static inline void my_tosort_unicode_bmp(const MY_UNICASE_INFO *uni_plane, |
my_wc_t *wc)
|
{
|
const MY_UNICASE_CHARACTER *page; |
DBUG_ASSERT(*wc <= uni_plane->maxchar);
|
if ((page= uni_plane->page[*wc >> 8])) |
*wc= page[*wc & 0xFF].sort;
|
}
|
|
static inline void my_tosort_unicode(const MY_UNICASE_INFO *uni_plane,
my_wc_t *wc)
{
if (*wc <= uni_plane->maxchar)
else
{ *wc= MY_CS_REPLACEMENT_CHARACTER; }}
|
Attachments
Issue Links
- blocks
-
MDEV-30577 Case folding for uca1400 collations is not up to date
-
- Closed
-
- relates to
-
MDEV-31068 Reuse duplicate case conversion code in ctype-utf8.c and ctype-ucs2.c
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue blocks |
Link |
This issue relates to |
Priority | Major [ 3 ] | Critical [ 2 ] |
issue.field.resolutiondate | 2023-04-18 06:53:58.0 | 2023-04-18 06:53:58.83 |
Fix Version/s | 10.10.4 [ 28522 ] | |
Fix Version/s | 10.11.3 [ 28524 ] | |
Fix Version/s | 11.1.1 [ 28704 ] | |
Fix Version/s | 11.0.2 [ 28706 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |