8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Simplest solution for CORE-4165: Replace the hierarchical union execution with the plain one.

This commit is contained in:
dimitr 2013-08-05 14:48:30 +00:00
parent 92587f68aa
commit 0a982811f0

View File

@ -4665,15 +4665,27 @@ select_expr_body
{ $$ = $1; }
| select_expr_body UNION distinct_noise query_term
{
UnionSourceNode* node = newNode<UnionSourceNode>();
node->dsqlClauses = newNode<RecSourceListNode>($1)->add($4);
UnionSourceNode* node = $1->as<UnionSourceNode>();
if (node && !node->recursive && !node->dsqlAll)
node->dsqlClauses->add($4);
else
{
node = newNode<UnionSourceNode>();
node->dsqlClauses = newNode<RecSourceListNode>($1)->add($4);
}
$$ = node;
}
| select_expr_body UNION ALL query_term
{
UnionSourceNode* node = newNode<UnionSourceNode>();
node->dsqlAll = true;
node->dsqlClauses = newNode<RecSourceListNode>($1)->add($4);
UnionSourceNode* node = $1->as<UnionSourceNode>();
if (node && !node->recursive && node->dsqlAll)
node->dsqlClauses->add($4);
else
{
node = newNode<UnionSourceNode>();
node->dsqlAll = true;
node->dsqlClauses = newNode<RecSourceListNode>($1)->add($4);
}
$$ = node;
}
;