Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL)
Description
SELECT 2 DIV 1; |
Field 1: `2 DIV 1`
|
Type: LONGLONG
|
Collation: binary (63)
|
Length: 1
|
Max_length: 1
|
Decimals: 0
|
Flags: BINARY NUM
|
CREATE OR REPLACE TABLE t1 AS SELECT 2 DIV 1 AS c; |
DESCRIBE t1;
|
+-------+--------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+--------+------+-----+---------+-------+
|
| c | int(1) | YES | | NULL | |
|
+-------+--------+------+-----+---------+-------+
|
Notice, result set metadata for SELECT 2 DIV 1 reports the data type as LONGLONG. This looks wrong.
A CREATE..SELECT query for the same expression correctly makes an INT column.
Result set metadata should be fixed to report LONG for all DIV expressions creating an INT column. LONGLONG should be reported only for DIV making a BIGINT column in CREATE..SELECT.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
- relates to
-
MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
- Closed
-
MDEV-12857 Out-of-range errors on CREATE..SELECT 2222222222 DIV 1
- Closed