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

COLUMN_CREATE unicode name breakage

    XMLWordPrintable

    Details

    • Sprint:
      10.2.11

      Description

      Possibly related to MDEV-461.

      When calling column_create with names set to utf8, one can successfully
      encode an emoji that takes 4 bytes in utf-8:

      adamj@localhost [1]> set names utf8;
      adamj@localhost [2]> select column_json(column_create('��', 1));
      +---------------------------------------+
      | column_json(column_create('��', 1))     |
      +---------------------------------------+
      | {"��":1}                                |
      +---------------------------------------+

      However if the connection is set to utf8mb4 this actually fails,
      counter-intuitively:

      adamj@localhost [3]> set names utf8mb4;
      adamj@localhost [4]> select column_json(column_create('��', 1));
      +------------------------------------+
      | column_json(column_create('?', 1)) |
      +------------------------------------+
      | {"?":1}                            |
      +------------------------------------+
       
      adamj@localhost [5]> select column_list(column_create('��', 1));
      +------------------------------------+
      | column_list(column_create('?', 1)) |
      +------------------------------------+
      | `?`                                |
      +------------------------------------+

      Other unicode characters work fine though:

      adamj@localhost [6]> select column_list(column_create('❤', 1));
      +--------------------------------------+
      | column_list(column_create('❤', 1))   |
      +--------------------------------------+
      | `❤`                                  |
      +--------------------------------------+

        Attachments

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            adamchainz Adam Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: