Minor bug fix

This commit is contained in:
Bernardo Damele 2011-04-10 22:44:08 +00:00
parent 6012ab1c46
commit 14219a3dac

View File

@ -329,7 +329,7 @@ class Agent:
if not Backend.getDbms():
return fields
if fields.startswith("(CASE") or fields.startswith("SUBSTR"):
if fields.startswith("(CASE") or fields.startswith("SUBSTR") or fields.startswith("MID("):
nulledCastedConcatFields = fields
else:
fields = fields.replace(", ", ",")
@ -369,7 +369,7 @@ class Agent:
fieldsSelectFrom = getCompiledRegex("\ASELECT%s\s+(.+?)\s+FROM\s+" % prefixRegex, re.I).search(query)
fieldsExists = getCompiledRegex("EXISTS(.*)", re.I).search(query)
fieldsSelect = getCompiledRegex("\ASELECT%s\s+(.*)" % prefixRegex, re.I).search(query)
fieldsSubstr = getCompiledRegex("\ASUBSTR", re.I).search(query)
fieldsSubstr = getCompiledRegex("\A(SUBSTR|MID\()", re.I).search(query)
fieldsNoSelect = query
if fieldsSubstr: