fix: Switch the position of LIMIT and OFFSET

MariaDB needs LIMIT before OFFSET. 
Whereas Postgres accepts LIMIT and OFFSET in any order
This commit is contained in:
Suraj Shetty 2019-05-13 13:41:56 +05:30 committed by GitHub
parent 1556805232
commit 02ff1a48da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,8 @@ def get_feed(start, page_length):
{match_conditions_comment}
) X
order by X.creation DESC
OFFSET %(start)s LIMIT %(page_length)s"""
LIMIT %(page_length)s
OFFSET %(start)s"""
.format(match_conditions_comment = match_conditions_comment,
match_conditions_communication = match_conditions_communication), {
"user": frappe.session.user,
@ -55,4 +56,4 @@ def get_heatmap_data():
where
date(creation) > subdate(curdate(), interval 1 year)
group by date(creation)
order by creation asc"""))
order by creation asc"""))