From 02ff1a48da13de127da40825c28156ea89b69601 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 13 May 2019 13:41:56 +0530 Subject: [PATCH] fix: Switch the position of LIMIT and OFFSET MariaDB needs LIMIT before OFFSET. Whereas Postgres accepts LIMIT and OFFSET in any order --- frappe/desk/page/activity/activity.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/desk/page/activity/activity.py b/frappe/desk/page/activity/activity.py index 3d15088fbd..31ade42e7c 100644 --- a/frappe/desk/page/activity/activity.py +++ b/frappe/desk/page/activity/activity.py @@ -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""")) \ No newline at end of file + order by creation asc"""))