[MDEV-5935] ROUND(INT, ...) is inconsistent about its data type Created: 2014-03-23  Updated: 2022-11-02  Resolved: 2022-11-02

Status: Closed
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.0.9
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 AS SELECT ROUND(0, 209), ROUND(0, @A := 209);
SHOW COLUMNS FROM t1;

returns:

+---------------------+--------------+------+-----+---------+-------+
| Field               | Type         | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+-------+
| ROUND(0, 209)       | int(1)       | NO   |     | 0       |       |
| ROUND(0, @A := 209) | double(17,0) | NO   |     | 0       |       |
+---------------------+--------------+------+-----+---------+-------+

It's not clear why data type for the second ROUND is double.
The expected type would be the same for both ROUNDs.

Looks like a regression. 5.5 created int(1) for both ROUNDs.



 Comments   
Comment by Sergei Golubchik [ 2022-11-02 ]

fixed before 10.3.37

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