Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3.27, 10.4.17, 10.5.8
-
None
Description
UNION of an UNSIGNED result, and a NULL result from a subquery, leads to wrong number of decimals. See the following two one liner test queries, which were run with `mysql --column-type-info`. This only started with 10.3.
MariaDB [test]> select CAST(1 as unsigned) union all select NULL; |
Field 1: `CAST(1 as unsigned)` |
Catalog: `def`
|
Database: ``
|
Table: ``
|
Org_table: ``
|
Type: NEWDECIMAL
|
Collation: binary (63) |
Length: 2 |
Max_length: 1 |
Decimals: 0 |
Flags: BINARY NUM
|
|
|
+---------------------+
|
| CAST(1 as unsigned) | |
+---------------------+
|
| 1 | |
| NULL |
|
+---------------------+
|
2 rows in set (0.000 sec) |
|
MariaDB [test]> select CAST(1 as unsigned) union all select * from (select NULL) t; |
Field 1: `CAST(1 as unsigned)` |
Catalog: `def`
|
Database: ``
|
Table: ``
|
Org_table: ``
|
Type: NEWDECIMAL
|
Collation: binary (63) |
Length: 42 |
Max_length: 40 |
Decimals: 39 |
Flags: BINARY NUM
|
|
|
+------------------------------------------+
|
| CAST(1 as unsigned) | |
+------------------------------------------+
|
| 1.00000000000000000000000000000000000000 | |
| NULL |
|
+------------------------------------------+
|
2 rows in set (0.000 sec) |
|
Attachments
Issue Links
- relates to
-
MDEV-12775 Reuse data type aggregation code for hybrid functions and UNION
- Closed