[MDEV-6865] Merge Bug#18935421 RPAD DIES WITH CERTAIN PADSTR INTPUTS.. Created: 2014-10-13  Updated: 2014-12-01  Resolved: 2014-11-17

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 5.5.40
Fix Version/s: 5.5.41

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: 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.


Generated at Thu Feb 08 07:15:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.