Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Test:
SET @json= '[ 11, 22 , 33]';
|
SELECT JSON_EXTRACT(@json, '$[-2 to 1]');
|
SELECT JSON_EXTRACT(@json, '$[-1 to 1]');
|
SELECT JSON_EXTRACT(@json, '$[-1 to 0]');
|
SELECT JSON_EXTRACT(@json, '$[0 to 0]');
|
SELECT JSON_EXTRACT(@json, '$[-0 to 0]');
|
SELECT JSON_EXTRACT(@json, '$[-0 to 1]');
|
SELECT JSON_EXTRACT(@json, '$[0 to -0]');
|
Actual result:
SET @json= '[ 11, 22 , 33]';
|
SELECT JSON_EXTRACT(@json, '$[-2 to 1]');
|
JSON_EXTRACT(@json, '$[-2 to 1]')
|
[22]
|
SELECT JSON_EXTRACT(@json, '$[-1 to 1]');
|
JSON_EXTRACT(@json, '$[-1 to 1]')
|
NULL
|
SELECT JSON_EXTRACT(@json, '$[-1 to 0]');
|
JSON_EXTRACT(@json, '$[-1 to 0]')
|
NULL
|
Warnings:
|
Warning 4042 Syntax error in JSON path in argument 2 to function 'json_extract' at position 9
|
SELECT JSON_EXTRACT(@json, '$[0 to 0]');
|
JSON_EXTRACT(@json, '$[0 to 0]')
|
NULL
|
Warnings:
|
Warning 4042 Syntax error in JSON path in argument 2 to function 'json_extract' at position 8
|
SELECT JSON_EXTRACT(@json, '$[-0 to 0]');
|
JSON_EXTRACT(@json, '$[-0 to 0]')
|
NULL
|
Warnings:
|
Warning 4042 Syntax error in JSON path in argument 2 to function 'json_extract' at position 9
|
SELECT JSON_EXTRACT(@json, '$[-0 to 1]');
|
JSON_EXTRACT(@json, '$[-0 to 1]')
|
[11, 22]
|
SELECT JSON_EXTRACT(@json, '$[0 to -0]');
|
JSON_EXTRACT(@json, '$[0 to -0]')
|
[11]
|
Look like '0' on the right side of range is bad value, but '-0' - is good value. Why?
Attachments
Issue Links
- relates to
-
MDEV-27911 Implement range notation for json path
- Closed