[MDEV-11568] JSON_CONTAINS_PATH returns incorrect results and produces wrong warning Created: 2016-12-14  Updated: 2016-12-16  Resolved: 2016-12-16

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

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_CONTAINS_PATH('{"a":{"b":"c"}}', 'one', '$.a.*');
+-------------------------------------------------------+
| JSON_CONTAINS_PATH('{"a":{"b":"c"}}', 'one', '$.a.*') |
+-------------------------------------------------------+
|                                                  NULL |
+-------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
 
MariaDB [test]> SHOW WARNINGS;
+---------+------+-----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                           |
+---------+------+-----------------------------------------------------------------------------------+
| Warning | 4044 | Wildcards in JSON path not allowed in argument 1 to function 'json_contains_path' |
+---------+------+-----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL 5.7

MySQL [test]> SELECT JSON_CONTAINS_PATH('{"a":{"b":"c"}}', 'one', '$.a.*');
+-------------------------------------------------------+
| JSON_CONTAINS_PATH('{"a":{"b":"c"}}', 'one', '$.a.*') |
+-------------------------------------------------------+
|                                                     1 |
+-------------------------------------------------------+
1 row in set (0.00 sec)



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

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

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