Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5.8, 10.5
-
None
-
Ubuntu 18.04 LTS
Description
JSON_ARRAYAGG() doesn't evaluate correct charset.
reproduce:
MariaDB [test]> CREATE TABLE t1 (a varchar(5));
|
Query OK, 0 rows affected (0.035 sec)
|
|
MariaDB [test]> INSERT INTO t1 VALUES ('a'),('ä');
|
Query OK, 2 rows affected (0.014 sec)
|
|
MariaDB [test]> select * from t1;
|
+------+
|
| a |
|
+------+
|
| a |
|
| ä |
|
+------+
|
2 rows in set (0.000 sec)
|
|
MariaDB [test]> SELECT JSON_ARRAYAGG(a) FROM t1;
|
+------------------+
|
| JSON_ARRAYAGG(a) |
|
+------------------+
|
| ["a","▒"] |
|
+------------------+
|
1 row in set (0.001 sec)
|
|
MariaDB [test]> SELECT JSON_ARRAY(a) FROM t1;
|
+---------------+
|
| JSON_ARRAY(a) |
|
+---------------+
|
| ["a"] |
|
| ["ä"] |
|
+---------------+
|
2 rows in set (0.000 sec)
|
|
MariaDB [test]> select @@version;
|
+--------------------------------------+
|
| @@version |
|
+--------------------------------------+
|
| 10.5.8-MariaDB-1:10.5.8+maria~bionic |
|
+--------------------------------------+
|
|
MariaDB [(none)]> select @@character_set_server,@@character_set_client,@@character_set_results,@@collation_connection;
|
+------------------------+------------------------+-------------------------+------------------------+
|
| @@character_set_server | @@character_set_client | @@character_set_results | @@collation_connection |
|
+------------------------+------------------------+-------------------------+------------------------+
|
| utf8mb4 | utf8 | utf8 | utf8_general_ci |
|
+------------------------+------------------------+-------------------------+------------------------+
|
1 row in set (0.000 sec)
|
Attachments
Issue Links
- is duplicated by
-
MDEV-31159 Wrong encoding produced by JSON_ARRAYAGG
-
- Closed
-
- relates to
-
MDEV-16620 Add support for JSON_ARRAYAGG and JSON_OBJECTAGG
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue relates to |
Description |
JSON_ARRAYAGG() doesn't evaluate correct charset.
reproduce: MariaDB [test]> CREATE TABLE t1 (a varchar(5)); Query OK, 0 rows affected (0.035 sec) MariaDB [test]> INSERT INTO t1 VALUES ('a'),('ä'); Query OK, 2 rows affected (0.014 sec) MariaDB [test]> select * from t1; +------+ | a | +------+ | a | | ä | +------+ 2 rows in set (0.000 sec) MariaDB [test]> SELECT JSON_ARRAYAGG(a) FROM t1; +------------------+ | JSON_ARRAYAGG(a) | +------------------+ | ["a","▒"] | +------------------+ 1 row in set (0.001 sec) MariaDB [test]> SELECT JSON_ARRAY(a) FROM t1; +---------------+ | JSON_ARRAY(a) | +---------------+ | ["a"] | | ["ä"] | +---------------+ 2 rows in set (0.000 sec) MariaDB [test]> select @@version; +--------------------------------------+ | @@version | +--------------------------------------+ | 10.5.8-MariaDB-1:10.5.8+maria~bionic | +--------------------------------------+ MariaDB [(none)]> select @@character_set_server,@@character_set_client,@@character_set_results,@@collation_connection; +------------------------+------------------------+-------------------------+------------------------+ | @@character_set_server | @@character_set_client | @@character_set_results | @@collation_connection | +------------------------+------------------------+-------------------------+------------------------+ | utf8mb4 | utf8 | utf8 | utf8_general_ci | +------------------------+------------------------+-------------------------+------------------------+ 1 row in set (0.000 sec) |
JSON_ARRAYAGG() doesn't evaluate correct charset.
reproduce: {noformat} MariaDB [test]> CREATE TABLE t1 (a varchar(5)); Query OK, 0 rows affected (0.035 sec) MariaDB [test]> INSERT INTO t1 VALUES ('a'),('ä'); Query OK, 2 rows affected (0.014 sec) MariaDB [test]> select * from t1; +------+ | a | +------+ | a | | ä | +------+ 2 rows in set (0.000 sec) MariaDB [test]> SELECT JSON_ARRAYAGG(a) FROM t1; +------------------+ | JSON_ARRAYAGG(a) | +------------------+ | ["a","▒"] | +------------------+ 1 row in set (0.001 sec) MariaDB [test]> SELECT JSON_ARRAY(a) FROM t1; +---------------+ | JSON_ARRAY(a) | +---------------+ | ["a"] | | ["ä"] | +---------------+ 2 rows in set (0.000 sec) MariaDB [test]> select @@version; +--------------------------------------+ | @@version | +--------------------------------------+ | 10.5.8-MariaDB-1:10.5.8+maria~bionic | +--------------------------------------+ MariaDB [(none)]> select @@character_set_server,@@character_set_client,@@character_set_results,@@collation_connection; +------------------------+------------------------+-------------------------+------------------------+ | @@character_set_server | @@character_set_client | @@character_set_results | @@collation_connection | +------------------------+------------------------+-------------------------+------------------------+ | utf8mb4 | utf8 | utf8 | utf8_general_ci | +------------------------+------------------------+-------------------------+------------------------+ 1 row in set (0.000 sec) {noformat} |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.5 [ 23123 ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Assignee | Alexey Botchkov [ holyfoot ] |
Workflow | MariaDB v3 [ 118801 ] | MariaDB v4 [ 142561 ] |
Assignee | Alexey Botchkov [ holyfoot ] | Rucha Deodhar [ rucha174 ] |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] |
Assignee | Rucha Deodhar [ rucha174 ] | Sergei Golubchik [ serg ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | In Testing [ 10301 ] |
Fix Version/s | 10.5.24 [ 29517 ] | |
Fix Version/s | 10.6.17 [ 29518 ] | |
Fix Version/s | 10.11.7 [ 29519 ] | |
Fix Version/s | 11.0.5 [ 29520 ] | |
Fix Version/s | 11.1.4 [ 29024 ] | |
Fix Version/s | 11.2.3 [ 29521 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Testing [ 10301 ] | Closed [ 6 ] |
Link |
This issue is duplicated by |
MariaDB [test]> set names latin1;
Query OK, 0 rows affected (0.000 sec)
MariaDB [test]> SELECT JSON_ARRAYAGG('ä');
+---------------------+
| JSON_ARRAYAGG('ä') |
+---------------------+
| ["ä"] |
+---------------------+
1 row in set (0.000 sec)
MariaDB [test]> set names utf8;
Query OK, 0 rows affected (0.000 sec)
MariaDB [test]> SELECT JSON_ARRAYAGG('ä');
+---------------------+
| JSON_ARRAYAGG('ä') |
+---------------------+
| ["�"] |
+---------------------+
1 row in set (0.000 sec)
MariaDB [test]> SELECT 'ä';
+----+
| ä |
+----+
| ä |
+----+
1 row in set (0.000 sec)