Mercurial > libervia-pubsub
comparison sat_pubsub/pgsql_storage.py @ 297:4115999d85e9
fixes behavior when maxItems is 0
author | souliane <souliane@mailoo.org> |
---|---|
date | Thu, 10 Sep 2015 15:03:12 +0200 |
parents | df1edebb0466 |
children | 05c875a13a62 |
comparison
equal
deleted
inserted
replaced
296:6ce33757d21e | 297:4115999d85e9 |
---|---|
745 query.append("AND date<(SELECT date FROM items WHERE item=%s LIMIT 1)") | 745 query.append("AND date<(SELECT date FROM items WHERE item=%s LIMIT 1)") |
746 args.append(rsm.after) | 746 args.append(rsm.after) |
747 | 747 |
748 query.append("ORDER BY date %s" % order) | 748 query.append("ORDER BY date %s" % order) |
749 | 749 |
750 if maxItems: | 750 if maxItems is not None: |
751 query.append("LIMIT %s") | 751 query.append("LIMIT %s") |
752 args.append(maxItems) | 752 args.append(maxItems) |
753 | 753 |
754 cursor.execute(' '.join(query), args) | 754 cursor.execute(' '.join(query), args) |
755 | 755 |