[MDEV-11571] JSON_EXTRACT returns wrong results Created: 2016-12-14  Updated: 2017-01-23  Resolved: 2017-01-23

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2
Fix Version/s: 10.2.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-9143 JSON_xxx functions Closed

 Description   

MariaDB 10.2

MariaDB [test]> SELECT JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]');
+--------------------------------------------+
| JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]') |
+--------------------------------------------+
| [20, [30, 40]]                             |
+--------------------------------------------+
1 row in set (0.00 sec)

MySQL 5.7

MySQL [test]> SELECT JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]');
+--------------------------------------------+
| JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]') |
+--------------------------------------------+
| 20                                         |
+--------------------------------------------+
1 row in set (0.00 sec)



 Comments   
Comment by Alexey Botchkov [ 2016-12-24 ]

http://lists.askmonty.org/pipermail/commits/2016-December/010334.html

Comment by Ian Gilfillan [ 2017-01-23 ]

This appears not to have been fixed for 10.2.3:

MariaDB 10.2.3

MariaDB [test]> SELECT JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]');
+--------------------------------------------+
| JSON_EXTRACT('[10, 20, [30, 40]]', '$[1]') |
+--------------------------------------------+
| [20, [30, 40]]                             |
+--------------------------------------------+
1 row in set (0.00 sec)

Comment by Elena Stepanova [ 2017-01-23 ]

anikitin, could you please take a look, maybe you've already created a new bug report about it.

Comment by Andrii Nikitin (Inactive) [ 2017-01-23 ]

I can confirm it is fixed in current 10.2 , and not fixed in 10.2.3
The checkin was on 24-Dec and the latest commit in 10.2.3 seems to be on 22-Dec, so it just didn't get into it.

Comment by Elena Stepanova [ 2017-01-23 ]

Okay, it happens, it was mislabeled. I'm changing the fix version and closing it again.

Generated at Thu Feb 08 07:50:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.