Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json_remove is not same with MySQL #9986

Closed
xiekeyi98 opened this issue Apr 2, 2019 · 2 comments
Closed

json_remove is not same with MySQL #9986

xiekeyi98 opened this issue Apr 2, 2019 · 2 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@xiekeyi98
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
select json_remove( '{"id": 123, "name": "systemQA", "array": [1, 2, 3]}', '$[0]' );
  1. What did you expect to see?

In MySQL

mysql> select json_remove( '{"id": 123, "name": "systemQA", "array": [1, 2, 3]}', '$[0]' );
+------------------------------------------------------------------------------+
| json_remove( '{"id": 123, "name": "systemQA", "array": [1, 2, 3]}', '$[0]' ) |
+------------------------------------------------------------------------------+
| {"id": 123, "name": "systemQA", "array": [1, 2, 3]}                          |
+------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> 
mysql> select version();
+-------------------------+
| version()               |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.01 sec)

mysql> 
  1. What did you see instead?

In TiDB

mysql> select json_remove( '{"id": 123, "name": "systemQA", "array": [1, 2, 3]}', '$[0]' );
+------------------------------------------------------------------------------+
| json_remove( '{"id": 123, "name": "systemQA", "array": [1, 2, 3]}', '$[0]' ) |
+------------------------------------------------------------------------------+
| {"array": [1, 2, 3], "id": 123, "name": "systemQA"}                          |
+------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> 
mysql> select version();
+----------------------------------------+
| version()                              |
+----------------------------------------+
| 5.7.25-TiDB-v3.0.0-beta-321-gc6a757b24 |
+----------------------------------------+
1 row in set (0.00 sec)

mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)

mysql> 
@xiekeyi98 xiekeyi98 added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility labels Apr 2, 2019
@erjiaqing
Copy link
Contributor

Maybe this is same as #9982

@xiekeyi98
Copy link
Contributor Author

@erjiaqing is right, close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility
Projects
None yet
Development

No branches or pull requests

2 participants