[MDEV-8514] Storing '1e-1000000000000' into an INT column produces a wrong result Created: 2015-07-21  Updated: 2018-10-15

Status: Open
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-8515 Explicit and implicit CAST from strin... Open

 Description   

SET sql_mode='';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES ('1e-1000000000000');
SHOW WARNINGS;
SELECT * FROM t1;

returns

+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'a' at row 1 |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)
 
+------------+
| a          |
+------------+
| 2147483647 |
+------------+
1 row in set (0.00 sec)

This is wrong. The expected result is 0.
The warning also does not look correct.


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