[MDEV-21662] UNION to sub-query with constant NULL incorrectly cast unsigned INT to DECIMAL(48,38) Created: 2020-02-04 Updated: 2023-12-20 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Subquery, Data types, Parser |
| Affects Version/s: | 10.3, 10.4, 10.11.6 |
| Fix Version/s: | 10.4, 10.5, 10.11 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Taylor Honsowetz | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | regression, regression-10.2 | ||
| Environment: |
mariadb:10.4.11-bionic container |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
To reproduce, first create and populate tables like this:
Then, execute the following select statement:
Which will incorrectly return the following:
Whereas the expected result should have been:
When a table is created from the query, it's clear that the column is incorrectly being cast as decimal(48,38):
|
| Comments |
| Comment by Elena Stepanova [ 2020-03-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Please paste or attach your cnf file(s).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Taylor Honsowetz [ 2020-03-09 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've attached my cnf file along with my docker-compose.yml | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2020-04-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can reproduce on 10.3-10.5 if in the table tab2 column is defined as unsigned int. (Somehow unsigned is mentioned in the summary of bug, but not in table definition).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-12-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Isn't this the simpler form:
UNSIGNED numbers are converted to DECIMAL when UNION with NULL while SIGNED are kept as LONGLONG. |