tidb icon indicating copy to clipboard operation
tidb copied to clipboard

A minor compatible issue when binary string is used for json_unquote

Open guo-shaoge opened this issue 3 years ago • 0 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

SELECT JSON_UNQUOTE(CAST('ABCD' AS BINARY));

2. What did you expect to see? (Required)

mysql> SELECT JSON_UNQUOTE(CAST('ABCD' AS BINARY));
ERROR 3144 (22032): Cannot create a JSON value from a string with CHARACTER SET 'binary'.

3. What did you see instead (Required)

mysql> SELECT JSON_UNQUOTE(CAST('ABCD' AS BINARY));
+--------------------------------------+
| JSON_UNQUOTE(CAST('ABCD' AS BINARY)) |
+--------------------------------------+
| ABCD                                 |
+--------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

master

guo-shaoge avatar Jun 19 '21 14:06 guo-shaoge