possible fix for Issue 1426:Count(*) query is incorrect when SQLFORM.grid() contains groupby parameter, thanks daveshih01
This commit is contained in:
2
VERSION
2
VERSION
@@ -1 +1 @@
|
||||
Version 2.4.5-stable+timestamp.2013.04.03.16.48.32
|
||||
Version 2.4.5-stable+timestamp.2013.04.04.21.10.38
|
||||
|
||||
@@ -2122,7 +2122,10 @@ class SQLFORM(FORM):
|
||||
dbset = dbset(subquery)
|
||||
try:
|
||||
if left or groupby:
|
||||
c = 'count(*)'
|
||||
if groupby:
|
||||
c = 'count(distinct %s)' % str(groupby)
|
||||
else:
|
||||
c = 'count(*)'
|
||||
nrows = dbset.select(c, left=left, cacheable=True,
|
||||
groupby=groupby).first()[c]
|
||||
elif dbset._db._adapter.dbengine=='google:datastore':
|
||||
|
||||
Reference in New Issue
Block a user