Postgresql and Mysql LIMIT fixes
This commit is contained in:
parent
cfd686ff59
commit
e4afbc98cd
@ -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=[]):
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user