From: drh Date: Sat, 8 Dec 2007 18:01:30 +0000 (+0000) Subject: Strengthen the tests for aggregate functions in GROUP BY clauses. X-Git-Tag: version-3.6.10~1576 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9213d9e5fb1c96f9661cc47ee20fc672fcb3c6d5;p=thirdparty%2Fsqlite.git Strengthen the tests for aggregate functions in GROUP BY clauses. Changes to test cases only. No changes to code. (CVS 4601) FossilOrigin-Name: 4be8e6765bf8bc48747b2542f2ed77066fb9dcb9 --- diff --git a/manifest b/manifest index c9b2a8e76e..afc3495cf8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sbug\sin\sthe\sdebugging\sprintf\slogic.\s(CVS\s4600) -D 2007-12-08T17:55:36 +C Strengthen\sthe\stests\sfor\saggregate\sfunctions\sin\sGROUP\sBY\sclauses.\nChanges\sto\stest\scases\sonly.\s\sNo\schanges\sto\scode.\s(CVS\s4601) +D 2007-12-08T18:01:31 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -383,7 +383,7 @@ F test/minmax2.test 8294b6728819608861ba0e06ac1d9a87c4d815b5 F test/misc1.test 1b89c02c4a33b49dee4cd1d20d161aaaba719075 F test/misc2.test 1ee89298de9c16b61454658b24999c403e86afe4 F test/misc3.test 7bd937e2c62bcc6be71939faf068d506467b1e03 -F test/misc4.test 21e8a275cadcf2ba2a9ac2c33ae024ecc5eaff3a +F test/misc4.test 91e8ed25c092c2bb4e0bb01864631e2930f8d7de F test/misc5.test 33b95f12f18b7b9558c79545503f05728fbf2c22 F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91 F test/misc7.test 3fbd0a9e3dd03331d9d76acd47bc179e1a97e15e @@ -597,7 +597,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P feef1b15d645d638b4a05742f214b0445fa7e176 -R b339a7ea6c28f4b6ee6a4c188d3c15c4 +P 1d6a9f5fafb862fb31c8589fa118a5672bad6abd +R 378bf8f52e8d83775a501365b0bea297 U drh -Z c74d5cd18bfa04a5ccaf7b0db6ea5a33 +Z 0788daae7a5c65291d88fcc1de49b7ff diff --git a/manifest.uuid b/manifest.uuid index 1784670d13..4d2c50d955 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1d6a9f5fafb862fb31c8589fa118a5672bad6abd \ No newline at end of file +4be8e6765bf8bc48747b2542f2ed77066fb9dcb9 \ No newline at end of file diff --git a/test/misc4.test b/test/misc4.test index 743d36507b..026dd032e3 100644 --- a/test/misc4.test +++ b/test/misc4.test @@ -13,7 +13,7 @@ # This file implements tests for miscellanous features that were # left out of other test files. # -# $Id: misc4.test,v 1.22 2007/08/13 15:28:35 danielk1977 Exp $ +# $Id: misc4.test,v 1.23 2007/12/08 18:01:31 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -98,7 +98,6 @@ do_test misc4-2.4 { # Ticket #966 # -ifcapable compound { do_test misc4-3.1 { execsql { CREATE TABLE Table1(ID integer primary key, Value TEXT); @@ -106,18 +105,33 @@ do_test misc4-3.1 { CREATE TABLE Table2(ID integer NOT NULL, Value TEXT); INSERT INTO Table2 VALUES(1, 'z'); INSERT INTO Table2 VALUES (1, 'a'); - SELECT ID, Value FROM Table1 - UNION SELECT ID, max(Value) FROM Table2 GROUP BY 1 - ORDER BY 1, 2; } -} {1 x 1 z} -do_test misc4-3.2 { catchsql { - SELECT ID, Value FROM Table1 - UNION SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 - ORDER BY 1, 2; + SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 ORDER BY 1, 2; } } {1 {aggregate functions are not allowed in the GROUP BY clause}} +ifcapable compound { + do_test misc4-3.2 { + execsql { + SELECT ID, Value FROM Table1 + UNION SELECT ID, max(Value) FROM Table2 GROUP BY 1 + ORDER BY 1, 2; + } + } {1 x 1 z} + do_test misc4-3.3 { + catchsql { + SELECT ID, Value FROM Table1 + UNION SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 + ORDER BY 1, 2; + } + } {1 {aggregate functions are not allowed in the GROUP BY clause}} + do_test misc4-3.4 { + catchsql { + SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 + UNION SELECT ID, Value FROM Table1 + ORDER BY 1, 2; + } + } {1 {aggregate functions are not allowed in the GROUP BY clause}} } ;# ifcapable compound # Ticket #1047. Make sure column types are preserved in subqueries.