Details
-
Type:
Bug
-
Status: Confirmed (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.3.32, 10.5.13, 10.6.5
-
Component/s: Data Manipulation - Subquery
-
Labels:None
-
Environment:Gentoo Linux
Description
The attached example column-headings-minimal.sql produces duplicate column-headings despite the fact that the first column is configure with AS col_one.
It seems that the relevant parts which trigger this (unexpected?) behaviour are:
- join with a subquery
- the sub-query contains an IFNULL or COALESCE
- the outer query uses GROUP BY (remove it and the problem is no longer there)
- it does not matter where one uses a "real" table or this virtual "seq_1_to..." tables
- the second attached SQL example column-headings-less-minimal.sql shows some more columns with IFNULL in addition to COALESCE and also selects the "vanilla" sequence column.
The example itself is "brain-damaged" of course, but I stumbled over this in a context where the SQL query is programmatically generated. I also think that whatever you do in the sub-query should not affect the column names of the outer query.