fix for a major bug reported by k1971@live.co.uk (1..9 99..)

This commit is contained in:
Miroslav Stampar 2011-05-01 15:47:00 +00:00
parent 494503b334
commit 900ee0ff93
2 changed files with 6 additions and 0 deletions

View File

@ -424,6 +424,9 @@ Alessandro Tanasi <alessandro@tanasi.it>
Andres Tarasco <atarasco@gmail.com>
for providing me with good feedback
Tom Thumb <k1971@live.co.uk>
for reporting a major bug
Kazim Bugra Tombul <mhackmail@gmail.com>
for reporting a minor bug

View File

@ -370,10 +370,13 @@ class Agent:
fieldsExists = getCompiledRegex("EXISTS(.*)", re.I).search(query)
fieldsSelect = getCompiledRegex("\ASELECT%s\s+(.*)" % prefixRegex, re.I).search(query)
fieldsSubstr = getCompiledRegex("\A(SUBSTR|MID\()", re.I).search(query)
fieldsMinMaxstr = getCompiledRegex("(?:MIN|MAX)\(([^\(\)]+)\)", re.I).search(query)
fieldsNoSelect = query
if fieldsSubstr:
fieldsToCastStr = query
elif fieldsMinMaxstr:
fieldsToCastStr = fieldsMinMaxstr.groups()[0]
elif fieldsExists:
fieldsToCastStr = fieldsSelect.groups()[0]
elif fieldsSelectTop: