1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-20732 Correctly set the length of the FORMAT() result for float data type as argument.

This commit is contained in:
Gagan Goel
2019-12-30 15:11:01 -05:00
committed by Robert Bindar
parent 1c97cd339e
commit f0ca9bc669
6 changed files with 28 additions and 5 deletions

View File

@@ -2723,6 +2723,22 @@ t2 CREATE TABLE `t2` (
`c1` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
CREATE OR REPLACE TABLE t1 (f float);
INSERT INTO t1 VALUES (3e38), (-3e38), (0), (12.34), (-12.34);
CREATE OR REPLACE TABLE t2 AS SELECT FORMAT(f,0) FROM t1;
SELECT * FROM t2;
FORMAT(f,0)
300,000,000,549,775,580,000,000,000,000,000,000,000
-300,000,000,549,775,580,000,000,000,000,000,000,000
0
12
-12
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`FORMAT(f,0)` varchar(53) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
#
# End of 10.4 tests
#