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 "Unsupported functions" already in server #8938

Closed
kolbe opened this issue Jun 14, 2022 · 4 comments
Closed

JSON "Unsupported functions" already in server #8938

kolbe opened this issue Jun 14, 2022 · 4 comments
Assignees
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.

Comments

@kolbe
Copy link
Contributor

kolbe commented Jun 14, 2022

The documentation for a long time has included several items in the "Unsupported functions" section of the "JSON Functions" documentation.

File: /release-6.1/functions-and-operators/json-functions.md

But these functions have actually been in the server for quite a while... since 5.1.0 or 5.2.0!

5.7.25-TiDB-v5.1.0 (root) [test]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.1.0
Edition: Community
Git Commit Hash: 8acd5c88471cb7b4d4c4a8ed73b4d53d6833f13e
Git Branch: heads/refs/tags/v5.1.0
UTC Build Time: 2021-06-24 07:08:50
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.001 sec)

5.7.25-TiDB-v5.1.0 (root) [test]> select json_pretty('{"doc":"JSON_PRETTY"}')\G
*************************** 1. row ***************************
json_pretty('{"doc":"JSON_PRETTY"}'): {
  "doc": "JSON_PRETTY"
}
1 row in set (0.001 sec)
5.7.25-TiDB-v5.2.0 (root) [test]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.2.0
Edition: Community
Git Commit Hash: 05d2210647d6a1503a8d772477e43b14a024f609
Git Branch: heads/refs/tags/v5.2.0
UTC Build Time: 2021-08-27 05:54:47
GoVersion: go1.16.5
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.001 sec)

5.7.25-TiDB-v5.2.0 (root) [test]> select json_merge_patch('{"a":0}','{"a":1}');
+---------------------------------------+
| json_merge_patch('{"a":0}','{"a":1}') |
+---------------------------------------+
| {"a": 1}                              |
+---------------------------------------+
1 row in set (0.001 sec)

5.7.25-TiDB-v5.2.0 (root) [test]> select json_arrayagg(c) from (select 1 as c union select 2 union select 3);
+------------------+
| json_arrayagg(c) |
+------------------+
| [3, 2, 1]        |
+------------------+
1 row in set (0.001 sec)
@TomShawn TomShawn added the area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. label Jun 14, 2022
@TomShawn
Copy link
Contributor

@lcwangchao Could you please update this document? Thanks~

@dveeden
Copy link
Contributor

dveeden commented Jun 17, 2022

I think #8762 fixed this for the master branch
@kolbe could you check https://docs.pingcap.com/tidb/dev/json-functions ?

If things in the master branch are fine then the next thing we need is to backport this to the right release branches.

@kolbe
Copy link
Contributor Author

kolbe commented Jun 17, 2022

Yes, you're very right that the master branch does include this content, I'm sorry I didn't mention that in my original report. Note that not all the functions were added to the server at the same time, so the backport/cherry-pick will need to be done carefully so that historical documentation versions are accurate.

@TomShawn
Copy link
Contributor

@dveeden Can we cherry-pick #8762 to v5.4, v5.3, v5.2, and v5.1, and make sure every cherry-pick is accurate to that version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.
Projects
None yet
Development

No branches or pull requests

4 participants