[MDEV-11465] JSON_LENGTH returns incorrect length Created: 2016-12-02  Updated: 2016-12-05  Resolved: 2016-12-05

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_length('{}');
+-------------------+
| json_length('{}') |
+-------------------+
|                 1 |
+-------------------+
1 row in set (0.01 sec)
 
MariaDB [test]> SELECT JSON_LENGTH('[1, 2, {"a": 3}]');
+---------------------------------+
| JSON_LENGTH('[1, 2, {"a": 3}]') |
+---------------------------------+
|                               4 |
+---------------------------------+
1 row in set (0.00 sec)

MySQL 5.7

MySQL [test]> select json_length('{}');
+-------------------+
| json_length('{}') |
+-------------------+
|                 0 |
+-------------------+
1 row in set (0.00 sec)
 
MySQL [test]> SELECT JSON_LENGTH('[1, 2, {"a": 3}]');
+---------------------------------+
| JSON_LENGTH('[1, 2, {"a": 3}]') |
+---------------------------------+
|                               3 |
+---------------------------------+
1 row in set (0.01 sec)



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

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

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