Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 5.5(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
I create a table with a FLOAT column and insert a value outside of the float supported range:
CREATE OR REPLACE TABLE t1(c1 FLOAT NOT NULL); |
INSERT IGNORE INTO t1 VALUES (1e+40); |
SELECT c1 FROM t1; |
+------------+
|
| c1 |
|
+------------+
|
| 3.40282e38 |
|
+------------+
|
Looks good so far. It truncated the value to the maximum supported FLOAT value, and a corresponding warning was issued.
Now I do the same with a column of the data type FLOAT(53,0):
CREATE OR REPLACE TABLE t1(c1 FLOAT(53,0) NOT NULL); |
INSERT IGNORE INTO t1 VALUES (1e+40); |
SELECT c1 FROM t1; |
+----+
|
| c1 |
|
+----+
|
| 0 |
|
+----+
|
It silently truncated the value to 0. This is wrong. The expected value should be a huge FLOAT value with a warning.
Attachments
Issue Links
- blocks
-
MDEV-23162 Improve Protocol performance for numeric data
- Closed