Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5.40
-
None
Description
The fix is available at:
https://bazaar.launchpad.net/~mysql/mysql-server/5.5/revision/tor.didriksen@oracle.com-20140707100530-itmypugpsoaejqtv
without tests though.
Test case:
SELECT RPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 10000, 0x0061DE989999) |
Also, rpad returns a wrong result in some cases (not repeatable in 10.0):
mysql> select hex(rpad(0x0061DDDD,2, _utf16 0x0000 COLLATE utf16_general_ci));
|
+-----------------------------------------------------------------+
|
| hex(rpad(0x0061DDDD,2, _utf16 0x0000 COLLATE utf16_general_ci)) |
|
+-----------------------------------------------------------------+
|
| 0061DDDD0000 |
|
+-----------------------------------------------------------------+
|
The expected result is NULL, as DDDD is not a valid code in utf16.
More bad result examples (not repeatable in 10.0):
mysql> SELECT HEX(RPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 3, 0x0061DDDD9999));
|
+----------------------------------------------------------------------+
|
| HEX(RPAD(_utf16 0x0061 COLLATE utf16_unicode_ci, 3, 0x0061DDDD9999)) |
|
+----------------------------------------------------------------------+
|
| 00610061DDDD99990061 |
|
+----------------------------------------------------------------------+
|
The expected result is NULL, as DDDD is not a valid utf16 character.