[MDEV-26691] SFORMAT: Pass down FLOAT as FLOAT, without upcast to DOUBLE Created: 2021-09-26  Updated: 2021-10-12  Resolved: 2021-10-09

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.7
Fix Version/s: 10.7.1

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-25015 Custom formatting of strings in Maria... Closed

 Description   

Split from MDEV-25015

10.7.0 53b2c1f4664a3cb90f583979d9aa2771b7e1c98d (Debug)

10.7.0-dbg>CREATE TABLE t1 (c1 FLOAT);
Query OK, 0 rows affected (0.013 sec)
 
10.7.0-dbg>INSERT INTO t1 VALUES (1.1);
Query OK, 1 row affected (0.003 sec)
 
10.7.0-dbg>SELECT * FROM t1;
+------+
| c1   |
+------+
|  1.1 |
+------+
1 row in set (0.001 sec)
 
10.7.0-dbg>SELECT SFORMAT('{}',(SELECT 1.1));
+----------------------------+
| SFORMAT('{}',(SELECT 1.1)) |
+----------------------------+
| 1.1                        |
+----------------------------+
1 row in set (0.000 sec)
 
10.7.0-dbg>SELECT SFORMAT('{}',(SELECT c1 FROM t1));
+-----------------------------------+
| SFORMAT('{}',(SELECT c1 FROM t1)) |
+-----------------------------------+
| 1.100000023841858                 |
+-----------------------------------+
1 row in set (0.001 sec)

And libfmt can print floats correctly, so pass float as float.


Generated at Thu Feb 08 09:47:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.