#At file:///home/bar/mysql-bzr/mysql-next-mr-bar2/ based on revid:bar@stripped
3107 Alexander Barkov 2010-03-04
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".
modified:
mysql-test/r/ctype_utf8mb4.result
strings/ctype-uca.c
=== modified file 'mysql-test/r/ctype_utf8mb4.result'
--- a/mysql-test/r/ctype_utf8mb4.result 2010-03-04 11:00:32 +0000
+++ b/mysql-test/r/ctype_utf8mb4.result 2010-03-04 12:02:30 +0000
@@ -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
=== modified file 'strings/ctype-uca.c'
--- a/strings/ctype-uca.c 2010-03-04 11:00:32 +0000
+++ b/strings/ctype-uca.c 2010-03-04 12:02:30 +0000
@@ -6983,11 +6983,18 @@ static int my_uca_scanner_next_any(my_uc
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))
Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20100304120230-x1cz1jvfdvp0fpzt.bundle
Thread |
---|
• bzr commit into mysql-next-mr branch (bar:3107) Bug#51675 Bug#51676 | Alexander Barkov | 4 Mar |