Bug #118497 When inserting floating-point data into JSON type, the query result precision is incorrect.

Submitted: 23 Jun 2025 1:11 Modified: 23 Jun 2025 4:20
Reporter: Alice Alice Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.0.41 OS:Any
Assigned to: CPU Architecture:Any
Tags: json

[23 Jun 2025 1:11] Alice Alice
Description:
 When inserting floating-point data into JSON type, the query result precision is incorrect. 

How to repeat:
mysql> CREATE TABLE `test1` (
    -> `id` int NOT NULL AUTO_INCREMENT,
    -> `json_col` json DEFAULT NULL,
    -> PRIMARY KEY (`id`)
    -> ) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)

mysql> insert into test1(json_col) values('{"id": 206, "name": "Str_9b8fae68", "value": 0.43434838152895533}');
Query OK, 1 row affected (0.01 sec)

mysql> select * from test1;
+----+------------------------------------------------------------------+
| id | json_col                                                         |
+----+------------------------------------------------------------------+
|  1 | {"id": 206, "name": "Str_9b8fae68", "value": 0.4343483815289554} |
+----+------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
[23 Jun 2025 1:17] Alice Alice
Sorry, this is a duplicate bug.
see: https://bugs.mysql.com/bug.php?id=83954

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.