Skip to content

JSON_SEARCH returns incorrect result for some special value #59463

Closed

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_SEARCH('{"h": "i"}', 'all', 'i', '\\', NULL);
+---------------------------------------------------+
| JSON_SEARCH('{"h": "i"}', 'all', 'i', '\\', NULL) |
+---------------------------------------------------+
| NULL                                              |
+---------------------------------------------------+
1 row in set (0.03 sec)

3. What did you see instead (Required)

mysql> SELECT JSON_SEARCH('{"h": "i"}', 'all', 'i', '\\', NULL);
+---------------------------------------------------+
| JSON_SEARCH('{"h": "i"}', 'all', 'i', '\\', NULL) |
+---------------------------------------------------+
| "$.h"                                             |
+---------------------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

Activity

  1. 5 remaining items

  2. added a commit that references this issue on Feb 26, 2025
    8b30027
  3. added a commit that references this issue on May 6, 2025
    5fb6d06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions