mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +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:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
|||||||
C When\sa\sCREATE\sTABLE\s...\sAS\sSELECT\sstatement\sfails,\smake\ssure\sthe\stable\sname\nis\sremoved\sfrom\sthe\sinternal\shash\stables.\s\sTicket\s#238.\s(CVS\s858)
|
C Make\sthe\sGROUP\sBY\sclause\swork\seven\sif\sthere\sare\sno\saggregate\sfunctions.\s(CVS\s859)
|
||||||
D 2003-02-01T13:53:28
|
D 2003-02-02T12:41:26
|
||||||
F Makefile.in 6606854b1512f185b8e8c779b8d7fc2750463d64
|
F Makefile.in 6606854b1512f185b8e8c779b8d7fc2750463d64
|
||||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||||
@@ -38,7 +38,7 @@ F src/pager.h 540833e8cb826b80ce2e39aa917deee5e12db626
|
|||||||
F src/parse.y cdaed5009423d851708848bd279147c268e6022e
|
F src/parse.y cdaed5009423d851708848bd279147c268e6022e
|
||||||
F src/printf.c f8fd911a8738f9b2eb07aca2870473d34707055d
|
F src/printf.c f8fd911a8738f9b2eb07aca2870473d34707055d
|
||||||
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
|
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
|
||||||
F src/select.c 77018f471976a80648dfb3996de52c2ddf5b8f9e
|
F src/select.c d12d4c12d6536deccdede90b482d24f0590f5dc8
|
||||||
F src/shell.c cbb29252f0bd7b144d1e3126e64e17e5a314f2fd
|
F src/shell.c cbb29252f0bd7b144d1e3126e64e17e5a314f2fd
|
||||||
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
|
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
|
||||||
F src/sqlite.h.in 6f648803f2ffb9beb35cb1cfa42b323d55519171
|
F src/sqlite.h.in 6f648803f2ffb9beb35cb1cfa42b323d55519171
|
||||||
@@ -98,7 +98,7 @@ F test/rowid.test 4c55943300cddf73dd0f88d40a268cab14c83274
|
|||||||
F test/select1.test 0d708cec567104653ec9aa49fecf3444a2e7d150
|
F test/select1.test 0d708cec567104653ec9aa49fecf3444a2e7d150
|
||||||
F test/select2.test aceea74fd895b9d007512f72499db589735bd8e4
|
F test/select2.test aceea74fd895b9d007512f72499db589735bd8e4
|
||||||
F test/select3.test 445a1a3dde4e2fd32541b311f55da5e2f8079d76
|
F test/select3.test 445a1a3dde4e2fd32541b311f55da5e2f8079d76
|
||||||
F test/select4.test 10ba54f24ef6ca7958a7045b001079378db2370c
|
F test/select4.test e7e9a32fa745246cb99fadbeb63af4843a17925b
|
||||||
F test/select5.test c2a6c4a003316ee42cbbd689eebef8fdce0db2ac
|
F test/select5.test c2a6c4a003316ee42cbbd689eebef8fdce0db2ac
|
||||||
F test/select6.test efb8d0c07a440441db87db2c4ade6904e1407e85
|
F test/select6.test efb8d0c07a440441db87db2c4ade6904e1407e85
|
||||||
F test/sort.test 61a729023ae4ac3be9b225dc0be026fb43fec4e6
|
F test/sort.test 61a729023ae4ac3be9b225dc0be026fb43fec4e6
|
||||||
@@ -155,7 +155,7 @@ F www/speed.tcl 4d463e2aea41f688ed320a937f93ff885be918c3
|
|||||||
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
|
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
|
||||||
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
|
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
|
||||||
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
|
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
|
||||||
P d93c1aeb544a5b1056424945eb43854213b30e50
|
P 65264780c553e8a00ec7a40cf76b89a11b245faf
|
||||||
R b5d305d3382423fe9540f0b4e0c64173
|
R bcf5d563cdfd66ab83ddebe53976490d
|
||||||
U drh
|
U drh
|
||||||
Z cd3aa5a5b1d7b6dd053874302f832e4b
|
Z de0eb8741aaf06b1a17e5c2252ef5c5a
|
||||||
|
@@ -1 +1 @@
|
|||||||
65264780c553e8a00ec7a40cf76b89a11b245faf
|
b68792315883eed8523f5e11856ec8378dc972c1
|
@@ -12,7 +12,7 @@
|
|||||||
** This file contains C code routines that are called by the parser
|
** This file contains C code routines that are called by the parser
|
||||||
** to handle SELECT statements in SQLite.
|
** 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"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -2177,8 +2177,9 @@ int sqliteSelect(
|
|||||||
/* Do an analysis of aggregate expressions.
|
/* Do an analysis of aggregate expressions.
|
||||||
*/
|
*/
|
||||||
sqliteAggregateInfoReset(pParse);
|
sqliteAggregateInfoReset(pParse);
|
||||||
if( isAgg ){
|
if( isAgg || pGroupBy ){
|
||||||
assert( pParse->nAgg==0 );
|
assert( pParse->nAgg==0 );
|
||||||
|
isAgg = 1;
|
||||||
for(i=0; i<pEList->nExpr; i++){
|
for(i=0; i<pEList->nExpr; i++){
|
||||||
if( sqliteExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){
|
if( sqliteExprAnalyzeAggregates(pParse, pEList->a[i].pExpr) ){
|
||||||
goto select_end;
|
goto select_end;
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
# focus of this file is testing UNION, INTERSECT and EXCEPT operators
|
# focus of this file is testing UNION, INTERSECT and EXCEPT operators
|
||||||
# in SELECT statements.
|
# in SELECT statements.
|
||||||
#
|
#
|
||||||
# $Id: select4.test,v 1.12 2002/06/22 02:33:39 drh Exp $
|
# $Id: select4.test,v 1.13 2003/02/02 12:41:27 drh Exp $
|
||||||
|
|
||||||
set testdir [file dirname $argv0]
|
set testdir [file dirname $argv0]
|
||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
@@ -467,5 +467,29 @@ do_test select4-7.4 {
|
|||||||
}
|
}
|
||||||
} {n 1 log 0 n 2 log 1}
|
} {n 1 log 0 n 2 log 1}
|
||||||
|
|
||||||
|
# Make sure DISTINCT works appropriately on TEXT and NUMERIC columns.
|
||||||
|
#
|
||||||
|
do_test select4-8.1 {
|
||||||
|
execsql {
|
||||||
|
BEGIN;
|
||||||
|
CREATE TABLE t3(a text, b float, c text);
|
||||||
|
INSERT INTO t3 VALUES(1, 1.1, '1.1');
|
||||||
|
INSERT INTO t3 VALUES(2, 1.10, '1.10');
|
||||||
|
INSERT INTO t3 VALUES(3, 1.10, '1.1');
|
||||||
|
INSERT INTO t3 VALUES(4, 1.1, '1.10');
|
||||||
|
INSERT INTO t3 VALUES(5, 1.2, '1.2');
|
||||||
|
INSERT INTO t3 VALUES(6, 1.3, '1.3');
|
||||||
|
COMMIT;
|
||||||
|
}
|
||||||
|
execsql {
|
||||||
|
SELECT DISTINCT b FROM t3 ORDER BY c;
|
||||||
|
}
|
||||||
|
} {1.1 1.2 1.3}
|
||||||
|
do_test select4-8.2 {
|
||||||
|
execsql {
|
||||||
|
SELECT DISTINCT c FROM t3 ORDER BY c;
|
||||||
|
}
|
||||||
|
} {1.1 1.10 1.2 1.3}
|
||||||
|
|
||||||
|
|
||||||
finish_test
|
finish_test
|
||||||
|
Reference in New Issue
Block a user