From 900ee0ff93620a6fefcbba327d985cbc35675b20 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 1 May 2011 15:47:00 +0000 Subject: [PATCH] fix for a major bug reported by k1971@live.co.uk (1..9 99..) --- doc/THANKS | 3 +++ lib/core/agent.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/THANKS b/doc/THANKS index 2751db832..de9810491 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -424,6 +424,9 @@ Alessandro Tanasi Andres Tarasco for providing me with good feedback +Tom Thumb + for reporting a major bug + Kazim Bugra Tombul for reporting a minor bug diff --git a/lib/core/agent.py b/lib/core/agent.py index 81436c67b..4c272739e 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -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: