From 3373e30808d29b417c45834f394685ccc4662445 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Sun, 20 Jan 2013 02:40:40 +0000 Subject: [PATCH] minor fix for a bug introduced with commit 1ad9e26a210f59c5a3fc5206c1b3772b1f7de4b5 --- lib/core/agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 0e0770b01..d133a8485 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -822,7 +822,9 @@ class Agent(object): limitedQuery += " %s" % limitStr elif Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2): - if " ORDER BY " in limitedQuery and "SELECT " in limitedQuery: + if not " ORDER BY " in limitedQuery: + limitStr = limitStr.replace(") WHERE LIMIT", " ORDER BY 1 ASC) WHERE LIMIT") + elif " ORDER BY " in limitedQuery and "SELECT " in limitedQuery: limitedQuery = limitedQuery[:limitedQuery.index(" ORDER BY ")] if query.startswith("SELECT "):