[MDEV-11470] JSON_KEYS accepts arguments in invalid format Created: 2016-12-02  Updated: 2017-01-24  Resolved: 2017-01-24

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: json-10.2

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

 Description   

Compare:

MariaDB 10.2

MariaDB [test]> SELECT JSON_KEYS('foo');
+------------------+
| JSON_KEYS('foo') |
+------------------+
| NULL             |
+------------------+
1 row in set (0.00 sec)

MySQL 5.7

MySQL [test]> SELECT JSON_KEYS('foo');
ERROR 3141 (22032): Invalid JSON text in argument 1 to function json_keys: "Invalid value." at position 1.



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

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

Comment by Ian Gilfillan [ 2017-01-23 ]

Similar to MDEV-11571, this one also appears not to have been fixed in 10.2.3, although the commit date is earlier. Will leave open to confirm whether it's fixed in 10.2.4.

Comment by Ian Gilfillan [ 2017-01-23 ]

Apologies, this was due to not having strict mode on, the warning does appear as expected.

SHOW WARNINGS;
+---------+------+-------------------------------------------------------------------------------+
| Level   | Code | Message                                                                       |
+---------+------+-------------------------------------------------------------------------------+
| Warning | 4038 | Syntax error in JSON text in argument 1 to function 'json_keys' at position 1 |
+---------+------+-------------------------------------------------------------------------------+

Safe to re-close, unfortunately I can't do so.

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