Skip to content

JSON_ARRAY_APPEND returns incorrect value for array arguments #59465

@YangKeao

Description

@YangKeao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

mysql> SELECT JSON_ARRAY_APPEND('[1]', '$', JSON_ARRAY(2, 3));
+-------------------------------------------------+
| JSON_ARRAY_APPEND('[1]', '$', JSON_ARRAY(2, 3)) |
+-------------------------------------------------+
| [1, [2, 3]]                                     |
+-------------------------------------------------+
1 row in set (0.05 sec)

3. What did you see instead (Required)

mysql> SELECT JSON_ARRAY_APPEND('[1]', '$', JSON_ARRAY(2, 3));
+-------------------------------------------------+
| JSON_ARRAY_APPEND('[1]', '$', JSON_ARRAY(2, 3)) |
+-------------------------------------------------+
| [1, 2, 3]                                       |
+-------------------------------------------------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions