The merged tables are improperly stripped from the union SQL. Since the columns from the subquery are merged in, you must also merge in the tables, because the columns may include values from joined tables.

The columns of the original query are also stripped. This caused problems with columns that were also listed in the GROUP BY clause.

I'm not 100% sure that the attached patch solves all cases, but it solves mine.

CommentFileSizeAuthor
views_union_sql.patch1.83 KBdouggreen

Comments

douggreen’s picture

Status: Needs review » Closed (won't fix)