solved another error in token->string procedure. this thing is quite hard

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@167 014f5005-505e-4b48-8d0a-63407b615a7c
master
LtWorf 2009-05-12 13:53:27 +07:00
parent e5e7dcddd2
commit dd15d6776b
2 changed files with 2 additions and 4 deletions

@ -338,7 +338,7 @@ def selection_and_product(n,rels):
c=both.pop(0)
for i in c:
n.prop+=i+ ' '
if len(both)>1:
if len(both)>0:
n.prop+=' and '
else:#No need for general select
n.name=n.child.name

@ -228,10 +228,8 @@ def optimize_all(expression,rels):
total=0
for i in optimizations.specific_optimizations:
total+=i(n,rels) #Performs the optimization
print n
for i in optimizations.general_optimizations:
total+=i(n) #Performs the optimization
print n
return n.__str__()
@ -281,7 +279,7 @@ if __name__=="__main__":
#n=tree("σ id==3 and indice==2 and name==5 or name<2(P1 * S1)")
#print optimizations.selection_and_product(n,rels)
print specific_optimize("σ id==3 and indice==2 and name==5 or name<2(P1 * S1)",rels)
print specific_optimize("σ name==skill and age>21 and id==indice and skill=='C'(P1*S1)",rels)
#print n
#print n.result_format(rels)