Skip to content

json-functions: Update status and links (#8762)#9023

Merged
shichun-0415 merged 2 commits into
pingcap:release-6.1from
ti-chi-bot:cherry-pick-8762-to-release-6.1
Jun 20, 2022
Merged

json-functions: Update status and links (#8762)#9023
shichun-0415 merged 2 commits into
pingcap:release-6.1from
ti-chi-bot:cherry-pick-8762-to-release-6.1

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

@ti-chi-bot ti-chi-bot commented Jun 20, 2022

This is an automated cherry-pick of #8762

What is changed, added or deleted? (Required)

Update the status of JSON functions in TiDB

mysql> CREATE TABLE t3 (id int primary key auto_increment, o_id int, attribute varchar(255), value varchar(255));
Query OK, 0 rows affected (0.12 sec)

mysql> INSERT INTO t3(o_id, attribute, value) VALUES(2,'color','red'),(2,'fabric','silk'),(3,'color','green'),(3,'shape','square');
Query OK, 4 rows affected (0.02 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> SELECT o_id, attribute, value FROM t3;
+------+-----------+--------+
| o_id | attribute | value  |
+------+-----------+--------+
|    2 | color     | red    |
|    2 | fabric    | silk   |
|    3 | color     | green  |
|    3 | shape     | square |
+------+-----------+--------+
4 rows in set (0.00 sec)

mysql> SELECT o_id, JSON_ARRAYAGG(attribute) AS attributes
    -> FROM t3 GROUP BY o_id;
+------+---------------------+
| o_id | attributes          |
+------+---------------------+
|    3 | ["color", "shape"]  |
|    2 | ["color", "fabric"] |
+------+---------------------+
2 rows in set (0.01 sec)

mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.0.0
Edition: Community
Git Commit Hash: 36a9810441ca0e496cbd22064af274b3be771081
Git Branch: heads/refs/tags/v6.0.0
UTC Build Time: 2022-03-31 10:33:28
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.01 sec)

mysql> SELECT JSON_PRETTY('{"k":"v"}');
+--------------------------+
| JSON_PRETTY('{"k":"v"}') |
+--------------------------+
| {
  "k": "v"
}           |
+--------------------------+
1 row in set (0.00 sec)

mysql> SELECT JSON_MERGE_PATCH('[1, 2]', '[true, false]');
+---------------------------------------------+
| JSON_MERGE_PATCH('[1, 2]', '[true, false]') |
+---------------------------------------------+
| [true, false]                               |
+---------------------------------------------+
1 row in set (0.00 sec)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v6.1 (TiDB 6.1 versions)
  • v6.0 (TiDB 6.0 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link
Copy Markdown
Member Author

ti-chi-bot commented Jun 20, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • dveeden

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. ONCALL Relates to documentation oncall. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. type/enhancement The issue or PR belongs to an enhancement. labels Jun 20, 2022
@ti-chi-bot ti-chi-bot requested a review from TomShawn June 20, 2022 05:59
Copy link
Copy Markdown
Contributor

@dveeden dveeden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v6.1.0

sql> SELECT JSON_MERGE_PATCH('[1, 2]', '[true, false]') a, JSON_PRETTY('{}') b, (SELECT JSON_ARRAYAGG(x) FROM (SELECT 'a' x UNION ALL SELECT 'b') a) c, tidb_version()\G
*************************** 1. row ***************************
             a: [true, false]
             b: {}
             c: ["a", "b"]
tidb_version(): Release Version: v6.1.0
Edition: Community
Git Commit Hash: 1a89decdb192cbdce6a7b0020d71128bc964d30f
Git Branch: heads/refs/tags/v6.1.0
UTC Build Time: 2022-06-05 05:15:11
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.0023 sec)

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 20, 2022
@shichun-0415
Copy link
Copy Markdown
Contributor

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member Author

This pull request has been accepted and is ready to merge.

DetailsCommit hash: b22d8bc

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 20, 2022
@shichun-0415 shichun-0415 merged commit a10823e into pingcap:release-6.1 Jun 20, 2022
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. ONCALL Relates to documentation oncall. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. type/enhancement The issue or PR belongs to an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants