From 002aca3f68d0b72132c8e994d0fb16b6442bf87b Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sat, 9 Apr 2016 10:07:44 +0200 Subject: [PATCH] Only holds for union Does not hold for other operations. --- relational/optimizations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/relational/optimizations.py b/relational/optimizations.py index d36c409..c637fbf 100644 --- a/relational/optimizations.py +++ b/relational/optimizations.py @@ -546,14 +546,14 @@ def projection_and_union(n, rels): if A and B are union compatible ''' changes = 0 - if n.name in {UNION, INTERSECTION, DIFFERENCE} and \ + if n.name == UNION and \ n.left.name == PROJECTION and \ n.right.name == PROJECTION and \ set(n.left.child.result_format(rels)) == set(n.right.child.result_format(rels)): newchild = parser.Node() newchild.kind = parser.BINARY - newchild.name = n.name + newchild.name = UNION newchild.left = n.left.child newchild.right = n.right.child