MXS-2850 Fix bug

This commit is contained in:
Johan Wikman
2020-01-28 11:08:27 +02:00
parent 36dee78cee
commit 399f312911

View File

@ -1247,6 +1247,11 @@ public:
IGNORE_COMPOUND_SELECTS
};
bool is_significant_union(const Select* pSelect)
{
return ((pSelect->op == TK_UNION) || (pSelect->op == TK_ALL)) && pSelect->pPrior;
}
void update_field_infos_from_select(QcAliases& aliases,
uint32_t context,
const Select* pSelect,
@ -1343,7 +1348,7 @@ public:
if (compound_approach == ANALYZE_COMPOUND_SELECTS)
{
if (((pSelect->op == TK_UNION) || (pSelect->op == TK_ALL)) && pSelect->pPrior)
if (is_significant_union(pSelect))
{
const Select* pPrior = pSelect->pPrior;
@ -2131,7 +2136,7 @@ public:
}
QcAliases aliases;
uint32_t context = (pSelect->op == TK_UNION && pSelect->pPrior) ? QC_FIELD_UNION : 0;
uint32_t context = is_significant_union(pSelect) ? QC_FIELD_UNION : 0;
update_field_infos_from_select(aliases, context, pSelect, NULL);
}