[MDEV-28900] Wrong value on conversion of '1.0.0' to INT Created: 2022-06-20  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.4, 10.5, 10.6

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


 Description   

This script:

SET sql_mode='';
CREATE OR REPLACE TABLE t1 (a INT);
INSERT INTO t1 VALUES ('1.0.0');
SELECT * FROM t1;

returns the following output:

Query OK, 1 row affected, 1 warning (0.001 sec)
 
+------+
| a    |
+------+
|   10 |
+------+

The value of 10 is wrong. The expected result is 1.

The problem is not repeatable with DOUBLE or DECIMAL data types.
The problem is not repeatable with explicit CAST('1.0.0' AS UNSIGNED)


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