From 771020abd60f2bb85e0b20a7abd8d469c9d21af4 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 7 Feb 2011 16:32:08 +0000 Subject: [PATCH] one more related commit --- lib/core/agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 62cbe3764..58c6f8448 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -677,7 +677,8 @@ class Agent: limitedQuery = "%s WHERE %s " % (limitedQuery, field if not uniqueField else uniqueField) limitedQuery += "NOT IN (%s" % (limitStr % num) - limitedQuery += "%s %s)" % (field if not uniqueField else uniqueField, fromFrom) + limitedQuery += "%s %s%s)" % (field if not uniqueField else uniqueField, fromFrom, (" ORDER BY %s" % uniqueField) if uniqueField else "") + if orderBy: limitedQuery += orderBy