- improved an optimization, to produce a simpler select condition under certain circumstances
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@343 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
@@ -475,7 +475,22 @@ def select_union_intersect_subtract(n):
|
||||
|
||||
newnode=parser.node()
|
||||
|
||||
newnode.prop='((%s) %s (%s))' % (n.left.prop,op,n.right.prop)
|
||||
if n.left.prop.startswith('(') or n.right.prop.startswith('('):
|
||||
t_str='('
|
||||
if n.left.prop.startswith('('):
|
||||
t_str+='(%s)'
|
||||
else:
|
||||
t_str+='%s'
|
||||
t_str+=' %s '
|
||||
if n.right.prop.startswith('('):
|
||||
t_str+='(%s)'
|
||||
else:
|
||||
t_str+='%s'
|
||||
t_str+=')'
|
||||
|
||||
newnode.prop= t_str % (n.left.prop,op,n.right.prop)
|
||||
else:
|
||||
newnode.prop='%s %s %s' % (n.left.prop,op,n.right.prop)
|
||||
newnode.name=SELECTION
|
||||
newnode.child=n.left.child
|
||||
newnode.kind=parser.UNARY
|
||||
|
Reference in New Issue
Block a user