Commit ee4ac8b7 authored by Daniele Venzano's avatar Daniele Venzano

Give a deterministic order when limiting number of executions

parent 982abc23
......@@ -94,11 +94,11 @@ class SQLManager:
args_list.append(value)
q += ' AND '.join(filter_list)
if limit > 0:
q += ' LIMIT {}'.format(limit)
q += ' ORDER BY id DESC LIMIT {}'.format(limit)
query = cur.mogrify(q, args_list)
else:
if limit > 0:
q_base += ' LIMIT {}'.format(limit)
q_base += ' ORDER BY id DESC LIMIT {}'.format(limit)
query = cur.mogrify(q_base)
cur.execute(query)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment