Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11.13
-
None
-
None
Description
Hi team,
Good day,
I was trying to extract elements from the JSON_TABLE Function and it is always returning first element of the array.
Steps to reproduce:
 |
MariaDB [(none)]> SELECT VALUE FROM JSON_TABLE( '[50,48,49]', '$[1]' COLUMNS( VALUE INT PATH '$' ) ) AS JT; |
+-------+
|
| VALUE |
|
+-------+
|
| 50 | |
+-------+
|
1 row in set (0.000 sec) |
MariaDB [(none)]> SELECT * FROM JSON_TABLE( '{"employees":[{"id":1,"info":{"name":"Alice"}},{"id":2,"info":{"name":"Bob"}}]}', '$.employees[1]' COLUMNS ( id INT PATH '$.id', name VARCHAR(100) PATH '$.info.name' ) ) AS jt; |
+------+-------+
|
| id | name |
|
+------+-------+
|
| 1 | Alice | |
+------+-------+
|
1 row in set (0.000 sec) |
In the above two examples.
I was expecting the second element in the array but it was always returning the first element.
This is not happening in 10.6.22.
Logs:
MariaDB [(none)]> SELECT VALUE FROM JSON_TABLE( '[50,48,49]', '$[2]' COLUMNS( VALUE INT PATH '$' ) ) AS JT |
-> ;
|
+-------+
|
| VALUE |
|
+-------+
|
| 49 | |
+-------+
|
1 row in set (0.001 sec) |
Can you please confirm if this is expected behaviour after 10.6?
Thanks,
Akilan RM.
Attachments
Issue Links
- duplicates
-
MDEV-36319 Wrong result json_table
-
- Confirmed
-