1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Make the GROUP BY clause work even if there are no aggregate functions. (CVS 859)

FossilOrigin-Name: b68792315883eed8523f5e11856ec8378dc972c1
This commit is contained in:
drh
2003-02-02 12:41:25 +00:00
parent 17e9e29d1e
commit bb999ef6fa
4 changed files with 36 additions and 11 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.125 2003/01/31 17:16:37 drh Exp $
** $Id: select.c,v 1.126 2003/02/02 12:41:26 drh Exp $
*/
#include "sqliteInt.h"
@@ -2177,8 +2177,9 @@ int sqliteSelect(
/* Do an analysis of aggregate expressions.
*/
sqliteAggregateInfoReset(pParse);
if( isAgg ){
if( isAgg || pGroupBy ){
assert( pParse->nAgg==0 );
isAgg = 1;
for(i=0; i<pEList->nExpr; i++){
if( sqliteExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){
goto select_end;