Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6865

Merge Bug#18935421 RPAD DIES WITH CERTAIN PADSTR INTPUTS..

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.40
    • Fix Version/s: 5.5.41
    • Component/s: Character Sets
    • 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.

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: