Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2.13, 10.2(EOL), 10.3(EOL)
-
None
-
tested with MariaDB 10.2.13 on Debian 8
-
10.3.6-1
Description
json_extract returns NULL for a number in scientific notation.
MariaDB [(none)]> select json_extract('{"test":8.437e-5}','$.test'); |
+--------------------------------------------+
|
| json_extract('{"test":8.437e-5}','$.test') | |
+--------------------------------------------+
|
| NULL |
|
+--------------------------------------------+
|
with the following warning
MariaDB [(none)]> show warnings;
|
+---------+------+----------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+----------------------------------------------------------------------------------+
|
| Warning | 4038 | Syntax error in JSON text in argument 1 to function 'json_extract' at position 8 | |
+---------+------+----------------------------------------------------------------------------------+
|
|
json value works.
+------------------------------------------+
|
| json_value('{"test":8.437e-5}','$.test') | |
+------------------------------------------+
|
| 8.437e-5 | |
+------------------------------------------+
|
1 row in set (0.00 sec) |
|
json_valid returns true for the given document
MariaDB [(none)]> select json_valid('{"test":8.437e-5}'); |
+---------------------------------+
|
| json_valid('{"test":8.437e-5}') | |
+---------------------------------+
|
| 1 | |
+---------------------------------+
|