From 6716b9299bc31bbdd66be35ba155c2e01acd298f Mon Sep 17 00:00:00 2001 From: Seif Lotfy Date: Sun, 13 May 2012 04:21:09 +0200 Subject: [PATCH] db-reader.vala: single out cases where the WHERE-CLAUSE is empty to fix the issue brought up in the commit 1 of bug #48834 --- src/db-reader.vala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/db-reader.vala b/src/db-reader.vala index f7c996f..b78afbc 100644 --- a/src/db-reader.vala +++ b/src/db-reader.vala @@ -586,6 +586,18 @@ public class DbReader : Object string aggregation_sql = ""; string order_sql = ""; + // Single out cases where the WHERE-CLAUSE is empty to fix the issue + // brought up in the commit 1 of bug #48834 + if (where_sql == "") + { + return """ + GROUP BY %s + ORDER BY %s + """.printf ( + field, + order_sql); + } + if (count_asc != null) { aggregation_sql = ", COUNT(%s) AS num_events".printf (field); -- 1.7.9.5