-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 10.0.21
-
Component/s: Character Sets, Dynamic Columns
-
Labels:None
-
Environment:Seen on both OS X 10.9 and Ubuntu 14.04
-
Sprint:10.2.11
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)) |
|
+--------------------------------------+
|
| `❤` |
|
+--------------------------------------+
|