Skip to content

Incompatible issue related to JSON functions #13710

@js00070

Description

@js00070

Bug Report

Seems there's an incompatible issue related to JSON functions

  1. What did you do?
select json_extract("\"asd\"","$") in ("asd","abcd");
  1. What did you expect to see?

in MySQL:5.7

mysql> select json_extract("\"asd\"","$") in ("asd","abcd");
+----------------------------------------------+
| json_extract("\"asd\"","$") in ("asd","abc") |
+----------------------------------------------+
|                                            0 |
+----------------------------------------------+
1 row in set, 1 warning (0.00 sec)

in MySQL:8

mysql> select json_extract("\"asd\"","$") in ("asd","abcd");
+-----------------------------------------------+
| json_extract("\"asd\"","$") in ("asd","abcd") |
+-----------------------------------------------+
|                                             1 |
+-----------------------------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?
MySQL [(none)]> select json_extract("\"asd\"","$") in ("asd","abcd");
ERROR 3140 (22032): Invalid JSON text: The document root must not be followed by other values.
MySQL [(none)]>
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v4.0.0-alpha-940-g92e774913
Git Commit Hash: 92e774913a2f6166b104d3d8eaed5513733f1830
Git Branch: master
UTC Build Time: 2019-11-24 03:10:38
GoVersion: go version go1.13.1 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions