From 86872956d539367f0ce5b83da4052d85fbeecb24 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Wed, 19 Dec 2012 22:55:31 +0000 Subject: [PATCH] minor bug fix (for PostgreSQL) --- lib/core/agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index 57ff0edac..56ec22590 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -732,7 +732,10 @@ class Agent(object): # (or equivalent, depending on the back-end DBMS) word if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.PGSQL, DBMS.SQLITE): stopLimit += startLimit - _ = expression.index(queries[Backend.getIdentifiedDbms()].limitstring.query) + if expression.find(queries[Backend.getIdentifiedDbms()].limitstring.query) > 0: + _ = expression.index(queries[Backend.getIdentifiedDbms()].limitstring.query) + else: + _ = expression.index("LIMIT ") expression = expression[:_] elif Backend.getIdentifiedDbms() in (DBMS.MSSQL, DBMS.SYBASE):