Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Test: (value in range 3 to 4 is absent)
SET @json= '[
|
[1, {"key1": "value1"}, 3],
|
[false, 5, 6],
|
[7, 8, [9, {"key2": 2}, 11]],
|
[15, 1.34, [14], ["string1", [16, {"key1":[1,2,3,[4,5,6]]}, 18]]],
|
[19, 20],
|
21, 22
|
]';
|
SELECT JSON_EXISTS(@json, '$[2][2][3]');
|
SELECT JSON_EXISTS(@json, '$[2][2][4]');
|
SELECT JSON_EXISTS(@json, '$[2][2][3 to 4]');
|
Expected result:
SET @json= '[
|
[1, {"key1": "value1"}, 3],
|
[false, 5, 6],
|
[7, 8, [9, {"key2": 2}, 11]],
|
[15, 1.34, [14], ["string1", [16, {"key1":[1,2,3,[4,5,6]]}, 18]]],
|
[19, 20],
|
21, 22
|
]';
|
SELECT JSON_EXISTS(@json, '$[2][2][3]');
|
JSON_EXISTS(@json, '$[2][2][3]')
|
0
|
SELECT JSON_EXISTS(@json, '$[2][2][4]');
|
JSON_EXISTS(@json, '$[2][2][4]')
|
0
|
SELECT JSON_EXISTS(@json, '$[2][2][3 to 4]');
|
JSON_EXISTS(@json, '$[2][2][3 to 4]')
|
0
|
Actual result:
SET @json= '[
|
[1, {"key1": "value1"}, 3],
|
[false, 5, 6],
|
[7, 8, [9, {"key2": 2}, 11]],
|
[15, 1.34, [14], ["string1", [16, {"key1":[1,2,3,[4,5,6]]}, 18]]],
|
[19, 20],
|
21, 22
|
]';
|
SELECT JSON_EXISTS(@json, '$[2][2][3]');
|
JSON_EXISTS(@json, '$[2][2][3]')
|
0
|
SELECT JSON_EXISTS(@json, '$[2][2][4]');
|
JSON_EXISTS(@json, '$[2][2][4]')
|
0
|
SELECT JSON_EXISTS(@json, '$[2][2][3 to 4]');
|
JSON_EXISTS(@json, '$[2][2][3 to 4]')
|
1
|
Attachments
Issue Links
- relates to
-
MDEV-27911 Implement range notation for json path
- Closed