Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.9.4, 10.10.2, 10.9(EOL), 10.10(EOL), 10.11
-
None
Description
To reproduce:
CREATE TABLE t3 (
|
j JSON
|
);
|
|
INSERT INTO t3 (j) VALUES ('[{"id": 1, "name": "Monty"},{"id": 2, "name": "Widenius"}]'); |
INSERT INTO t3 (j) VALUES ('[{"id": 1, "name": "Monty"},{"id": 2, "name": "Widenius"}]'); |
|
SELECT JSON_EXTRACT(j, '$[0 to 1]') FROM t3 ; |
Expected result:
[{"id": 1, "name": "Monty"}, {"id": 2, "name": "Widenius"}] |
[{"id": 1, "name": "Monty"}, {"id": 2, "name": "Widenius"}] |
Current result
[{"id": 1, "name": "Monty"}, {"id": 2, "name": "Widenius"}] |
{"id": 1, "name": "Monty"} |
Attachments
Issue Links
- is duplicated by
-
MDEV-30308 Query using JSON_EXTRACT on a json object containing a nested array returns different result using or not using WHERE
-
- Closed
-
-
MDEV-30466 Extracting value from a JSON array using JSON_EXTRACT inconsistent among versions
-
- Closed
-
- relates to
-
MDEV-27911 Implement range notation for json path
-
- Closed
-
Also when using * instead of json range (
MDEV-30308):MariaDB [test]> SELECT JSON_EXTRACT(j, '$[*]') FROM t3 ;
+-------------------------------------------------------------+
| JSON_EXTRACT(j, '$[*]') |
+-------------------------------------------------------------+
| [{"id": 1, "name": "Monty"}, {"id": 2, "name": "Widenius"}] |
| {"id": 1, "name": "Monty"} |
+-------------------------------------------------------------+
2 rows in set (0,001 sec)