The second argument of a LIMIT clause in an SQL query corresponds to the number of rows, not to the last index.

fixed #141
This commit is contained in:
Antoine Nguyen
2011-06-20 13:40:04 +02:00
parent c3ee07a419
commit b403107a8e
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ SELECT msgs.from_addr, maddr.email, msgs.subject, msgs.content, quarantine.mail_
msgs.time_num, msgs.content, msgrcpt.rs
%s
LIMIT %d,%d
""" % (query, start - 1, stop - 1))
""" % (query, start - 1, kwargs["nbelems"]))
if not status:
print cursor
return []
+2 -1
View File
@@ -109,7 +109,8 @@ class EmailListing:
def fetch(self, request, id_start, id_stop):
table = self.tbltype(self.mbc.fetch(start=id_start, stop=id_stop,
folder=self.folder))
folder=self.folder,
nbelems=self.elems_per_page))
tpl = Template("""
<form method="POST" id="listingform">
{{ table }}