mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Bug#51675 Server crashes on inserting 4 byte char. after ALTER TABLE to 'utf8mb4'
Bug#51676 Server crashes on SELECT, ORDER BY on 'utf8mb4' column An additional fix. We should use 0xFFFD as a weight for supplementary characters, not the "weight for character U+FFFD".
This commit is contained in:
parent
19bda05a3c
commit
79cecfb55e
2 changed files with 13 additions and 6 deletions
|
@ -2456,16 +2456,16 @@ t1 CREATE TABLE `t1` (
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t1 ORDER BY 1;
|
||||
subject p
|
||||
𐐀 NULL
|
||||
abc𐐀def NULL
|
||||
𐐀 NULL
|
||||
SELECT hex(subject), length(subject), char_length(subject), octet_length(subject) FROM t1 ORDER BY 1;
|
||||
hex(subject) length(subject) char_length(subject) octet_length(subject)
|
||||
616263F0909080646566 10 7 10
|
||||
F0909080 4 1 4
|
||||
SELECT subject FROM t1 ORDER BY 1;
|
||||
subject
|
||||
𐐀
|
||||
abc𐐀def
|
||||
𐐀
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
|
|
|
@ -6983,11 +6983,18 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner)
|
|||
scanner->send)) <= 0))
|
||||
return -1;
|
||||
|
||||
if (wc > 0xFFFF)
|
||||
wc= MY_CS_REPLACEMENT_CHARACTER;
|
||||
scanner->page= wc >> 8;
|
||||
scanner->code= wc & 0xFF;
|
||||
scanner->sbeg+= mb_len;
|
||||
if (wc > 0xFFFF)
|
||||
{
|
||||
/* Return 0xFFFD as weight for all characters outside BMP */
|
||||
scanner->wbeg= nochar;
|
||||
return 0xFFFD;
|
||||
}
|
||||
else
|
||||
{
|
||||
scanner->page= wc >> 8;
|
||||
scanner->code= wc & 0xFF;
|
||||
}
|
||||
|
||||
if (scanner->contractions && !scanner->page &&
|
||||
(scanner->code > 0x40) && (scanner->code < 0x80))
|
||||
|
|
Loading…
Reference in a new issue