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
-
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | Data types [ 13906 ] |
Link |
This issue relates to |
Assignee | Dmitry Shulga [ JIRAUSER47315 ] |
Assignee | Dmitry Shulga [ JIRAUSER47315 ] | Rucha Deodhar [ rucha174 ] |
Fix Version/s | 10.3.28 [ 25111 ] |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.3.28 [ 25111 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Rucha Deodhar [ rucha174 ] | Alexander Barkov [ bar ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Alexander Barkov [ bar ] | Rucha Deodhar [ rucha174 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Rucha Deodhar [ rucha174 ] | Alexander Barkov [ bar ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.3.28 [ 25111 ] | |
Fix Version/s | 10.4.18 [ 25110 ] | |
Fix Version/s | 10.5.9 [ 25109 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 116769 ] | MariaDB v4 [ 158678 ] |
Zendesk Related Tickets | 141151 |
it was changed after https://github.com/MariaDB/server/commit/705fc43eaa (
MDEV-12775)