We're updating the issue view to help you get more done.Learn more

Wrong metadata or column type for LEAST(1.0,'10')

There is a difference in column type metadata and actual column type
created for LEAST(1.0,'10'):

$ mysql --column-type-info test
MariaDB [test]> select least(1.0,'10');
Field   1:  `least(1.0,'10')`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  binary (63)
Length:     23
Max_length: 1
Decimals:   31
Flags:      NOT_NULL BINARY 
+-----------------+
| least(1.0,'10') |
+-----------------+
| 1               |
+-----------------+
1 row in set (0.00 sec)

Notice, the reported column type is VAR_STRING.

However,

$ mysql  test
MariaDB [test]> drop table if exists t1; create table t1 as select least(1.0,'10') as a; show create table t1;

+-------+----------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                 |
+-------+----------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` double NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Notice, column type is DOUBLE.

Status