From c72353321d59a30de876949f7f6e58085843790c Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 14 Feb 2013 13:36:33 +0100 Subject: [PATCH] Minor update for an Issue #392 --- lib/core/agent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/agent.py b/lib/core/agent.py index 4440e929f..7ce9a844f 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -874,6 +874,9 @@ class Agent(object): limitedQuery += "NOT IN (%s" % (limitStr % num) limitedQuery += "%s %s ORDER BY %s) ORDER BY %s" % (self.nullAndCastField(uniqueField or field), fromFrom, uniqueField or "1", uniqueField or "1") else: + match = re.search(" ORDER BY (\w+)\Z", query) + field = match.group(1) if match else field + if " WHERE " in limitedQuery: limitedQuery = "%s AND %s " % (limitedQuery, field) else: