1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Allow GROUP BY on aggregate queries only. Ticket #1039. (CVS 2176)

FossilOrigin-Name: 8ef2c644ebce851d7a3e0db3b2266fc2519485cd
This commit is contained in:
drh
2005-01-03 02:26:54 +00:00
parent c89b91beee
commit 49d642dba8
5 changed files with 30 additions and 15 deletions

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is page cache subsystem.
#
# $Id: collate3.test,v 1.6 2004/11/22 13:35:42 danielk1977 Exp $
# $Id: collate3.test,v 1.7 2005/01/03 02:26:55 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -109,11 +109,16 @@ do_test collate3-2.6 {
SELECT * FROM collate3t1;
}
} {0 {}}
do_test collate3-2.7 {
do_test collate3-2.7.1 {
catchsql {
SELECT count(*) FROM collate3t1 GROUP BY c1;
}
} {1 {no such collation sequence: string_compare}}
do_test collate3-2.7.2 {
catchsql {
SELECT * FROM collate3t1 GROUP BY c1;
}
} {1 {no such collation sequence: string_compare}}
} {1 {GROUP BY may only be used on aggregate queries}}
do_test collate3-2.8 {
catchsql {
SELECT DISTINCT c1 FROM collate3t1;

View File

@ -10,7 +10,7 @@
# focus of this file is testing compute SELECT statements and nested
# views.
#
# $Id: select7.test,v 1.3 2004/11/22 13:35:42 danielk1977 Exp $
# $Id: select7.test,v 1.4 2005/01/03 02:26:55 drh Exp $
set testdir [file dirname $argv0]
@ -52,5 +52,11 @@ do_test select7-2.1 {
} ;# ifcapable compound
# Do not allow GROUP BY without an aggregate. Ticket #1039.
#
do_test select7-3.1 {
catchsql {
SELECT * FROM (SELECT * FROM sqlite_master) GROUP BY name
}
} {1 {GROUP BY may only be used on aggregate queries}}
finish_test