From 842fb69ddeff65f8fde5f808e05e8145674ca5b1 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 14 Jul 2012 17:55:25 -0500 Subject: [PATCH] fixed recent bug in count --- VERSION | 2 +- gluon/dal.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 3231ceb5..74bcbc09 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-07-14 17:50:45) dev +Version 2.00.0 (2012-07-14 17:55:21) dev diff --git a/gluon/dal.py b/gluon/dal.py index 80fb2d4d..ad28a276 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -959,7 +959,8 @@ class BaseAdapter(ConnectionPool): return 'UPPER(%s)' % self.expand(first) def COUNT(self, first, distinct=None): - return 'COUNT()' if not distinct else 'COUNT(DISTINCT %s)' % self.expand(first) + return ('COUNT(%s)' if not distinct else 'COUNT(DISTINCT %s)') \ + % self.expand(first) def EXTRACT(self, first, what): return "EXTRACT(%s FROM %s)" % (what, self.expand(first))