Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3.32, 10.5.13, 10.6.5, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL)
-
None
-
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.