diff --git a/gramps/plugins/database/dbapi_support/mysql.py b/gramps/plugins/database/dbapi_support/mysql.py index c987ae681..555fa54c5 100644 --- a/gramps/plugins/database/dbapi_support/mysql.py +++ b/gramps/plugins/database/dbapi_support/mysql.py @@ -35,8 +35,9 @@ class MySQL(object): ## LIMIT -1 ## LIMIT offset, -1 query = query.replace("LIMIT -1", - "LIMIT 18446744073709551615") ## largest maxint - #query = query.replace("LIMIT -1", "") + "LIMIT 18446744073709551615") ## + ## FIXME: regex match: + #query = query.replace("LIMIT .*,-1", "LIMIT $1, ALL") return query def execute(self, query, args=[]): diff --git a/gramps/plugins/database/dbapi_support/postgresql.py b/gramps/plugins/database/dbapi_support/postgresql.py index 975c99334..1a5a05e4b 100644 --- a/gramps/plugins/database/dbapi_support/postgresql.py +++ b/gramps/plugins/database/dbapi_support/postgresql.py @@ -28,6 +28,8 @@ class Postgresql(object): sql = sql.replace("?", "%s") sql = sql.replace("REGEXP", "~") sql = sql.replace("desc", "desc_") + sql = sql.replace("LIMIT -1", "LIMIT all") + ## FIXME: limit offset, -1 if len(args) > 1: args = args[1] else: @@ -57,6 +59,7 @@ class Postgresql(object): sql = sql.replace("?", "%s") sql = sql.replace("BLOB", "bytea") sql = sql.replace("desc", "desc_") + sql = sql.replace("LIMIT -1", "LIMIT all") try: self.cursor.execute(sql) except Exception as exc: