Details
Description
JSON_EXTRACT function prints the output as NULL when setting character sets with mbminlen > 1
Character sets with mbminlen > 1
11.5.0-dbg>set character_set_connection=ucs2; |
Query OK, 0 rows affected (0.000 sec) |
Actual result
11.5.0-dbg>SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a'); |
+---------------------------------------+ |
| JSON_EXTRACT('{"a": 1,"b": 2}','$.a') | |
+---------------------------------------+ |
| NULL | |
+---------------------------------------+ |
1 row in set, 1 warning (0.000 sec) |
|
11.5.0-dbg>
|
Expected result
11.5.0-dbg>SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a'); |
+---------------------------------------+ |
| JSON_EXTRACT('{"a": 1,"b": 2}','$.a') | |
+---------------------------------------+ |
| 1 |
|
+---------------------------------------+ |
1 row in set (0.000 sec) |
|
11.5.0-dbg>
|
Character sets with mbminlen = 1
11.5.0-dbg>set character_set_connection=utf8; |
Query OK, 0 rows affected (0.000 sec) |
|
11.5.0-dbg>SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a'); |
+---------------------------------------+ |
| JSON_EXTRACT('{"a": 1,"b": 2}','$.a') | |
+---------------------------------------+ |
| 1 |
|
+---------------------------------------+ |
1 row in set (0.000 sec) |
|
11.5.0-dbg>
|
Attachments
Issue Links
- relates to
-
MDEV-34143 Server crashes when executing JSON_EXTRACT after setting non-default collation_connection
- Closed