From d87234348192d9bc7279b90507c7dace40444423 Mon Sep 17 00:00:00 2001 From: LtWorf Date: Thu, 19 Mar 2009 13:30:35 +0000 Subject: [PATCH] added some comments git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@116 014f5005-505e-4b48-8d0a-63407b615a7c --- CHANGELOG | 1 + relational/optimizer.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 10064e8..0a5bab6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -68,3 +68,4 @@ 0.10 - In optimizer, added a function that tokenizes an expression - Document about complexity of operations +- Bug: error in rename operator, it didn't perform a fullcopy of the relation \ No newline at end of file diff --git a/relational/optimizer.py b/relational/optimizer.py index caa088e..63650ac 100644 --- a/relational/optimizer.py +++ b/relational/optimizer.py @@ -95,18 +95,18 @@ def tokenize(expression): items.append(tokenize(expression[1:end])) expression=expression[end+1:].strip() - elif expression.startswith("σ") or expression.startswith("π") or expression.startswith("ρ"): #Unary + elif expression.startswith("σ") or expression.startswith("π") or expression.startswith("ρ"): #Unary 2 bytes items.append(expression[0:2]) #Adding operator in the top of the list expression=expression[2:].strip() #Removing operator from the expression par=expression.find('(') items.append(expression[:par]) #Inserting parameter of the operator expression=expression[par:].strip() #Removing parameter from the expression - elif expression.startswith("*") or expression.startswith("-"): + elif expression.startswith("*") or expression.startswith("-"): # Binary 1 byte items.append(expression[0]) expression=expression[1:].strip() #1 char from the expression state=4 - elif expression.startswith("ᑎ") or expression.startswith("ᑌ"): #Binary short + elif expression.startswith("ᑎ") or expression.startswith("ᑌ"): #Binary short 3 bytes items.append(expression[0:3]) #Adding operator in the top of the list expression=expression[3:].strip() #Removing operator from the expression