mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
Do not allow aggregate functions in a WHERE clause. Ticket #1514. (CVS 2769)
FossilOrigin-Name: bb866ed880c33ec9ce6ded8ebdbb459fedf9c257
This commit is contained in:
13
manifest
13
manifest
@@ -1,5 +1,5 @@
|
||||
C Avoid\sunnecessary\sstrlen()\scalls\sin\sthe\sOP_String\sopcode.\s(CVS\s2768)
|
||||
D 2005-11-16T04:34:32
|
||||
C Do\snot\sallow\saggregate\sfunctions\sin\sa\sWHERE\sclause.\s\sTicket\s#1514.\s(CVS\s2769)
|
||||
D 2005-11-16T12:53:15
|
||||
F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1
|
||||
F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
|
||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||
@@ -41,7 +41,7 @@ F src/complete.c 4de937dfdd4c79a501772ab2035b26082f337a79
|
||||
F src/date.c 7444b0900a28da77e57e3337a636873cff0ae940
|
||||
F src/delete.c 29dac493f4d83b05f91233b116827c133bcdab72
|
||||
F src/experimental.c 50c1e3b34f752f4ac10c36f287db095c2b61766d
|
||||
F src/expr.c fa22a2ed9d277e3bd4467842fbc025e106fd0d51
|
||||
F src/expr.c 3b1a24aab6a17e7cc62d904eba802beccc3e925f
|
||||
F src/func.c 7d81dccd9c440c6c4e761056333e629192814af0
|
||||
F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863
|
||||
F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84
|
||||
@@ -227,6 +227,7 @@ F test/tkt1444.test 5ef55d36dba1a39a96c728a519e66378a6f6816f
|
||||
F test/tkt1449.test f8de8a84ec12ee805ed80055e1209560f8bee4d8
|
||||
F test/tkt1473.test e4637c27d606fd002de78113a8e1a142e48ffb18
|
||||
F test/tkt1512.test 8efd8d07e27e99d7462f75b5711de65eb7708baf
|
||||
F test/tkt1514.test baa587a69fa2e8d575ebdaf1460f711281dcba49
|
||||
F test/trace.test 9fd28695c463b90c2d32c387a432e01eb26e8ccf
|
||||
F test/trans.test 10506dc30305cfb8c4098359f7f6f64786f69c5e
|
||||
F test/trigger1.test 152aed5a1fa90709fe171f2ca501a6b7f7901479
|
||||
@@ -317,7 +318,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49
|
||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
|
||||
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
||||
P 25fa16a2e1f324790f4b293df5d7142575034428
|
||||
R 6947ef477ab782876c329e5cbcb856d9
|
||||
P 2e195e96bcbad104da09ebe6cef617e0e9ef1884
|
||||
R ffdeff6933e9c8149230cb664075bfe1
|
||||
U drh
|
||||
Z 45b9b11236dc8332f514b54b24426e7f
|
||||
Z b747cc0c814ab502d11e59e2f8d36ee2
|
||||
|
||||
@@ -1 +1 @@
|
||||
2e195e96bcbad104da09ebe6cef617e0e9ef1884
|
||||
bb866ed880c33ec9ce6ded8ebdbb459fedf9c257
|
||||
@@ -12,7 +12,7 @@
|
||||
** This file contains routines used for analyzing expressions and
|
||||
** for generating VDBE code that evaluates expressions in SQLite.
|
||||
**
|
||||
** $Id: expr.c,v 1.237 2005/11/14 22:29:05 drh Exp $
|
||||
** $Id: expr.c,v 1.238 2005/11/16 12:53:15 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -1650,7 +1650,12 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
|
||||
}
|
||||
case TK_AGG_FUNCTION: {
|
||||
AggInfo *pInfo = pExpr->pAggInfo;
|
||||
if( pInfo==0 ){
|
||||
sqlite3ErrorMsg(pParse, "misuse of aggregate: %T",
|
||||
&pExpr->span);
|
||||
}else{
|
||||
sqlite3VdbeAddOp(v, OP_MemLoad, pInfo->aFunc[pExpr->iAgg].iMem, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TK_CONST_FUNC:
|
||||
|
||||
27
test/tkt1514.test
Normal file
27
test/tkt1514.test
Normal file
@@ -0,0 +1,27 @@
|
||||
# 2005 November 16
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library.
|
||||
#
|
||||
# This file implements tests to verify that ticket #1514 is
|
||||
# fixed.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_test tkt1514-1.1 {
|
||||
catchsql {
|
||||
CREATE TABLE t1(a,b);
|
||||
SELECT a FROM t1 WHERE max(b)<10 GROUP BY a;
|
||||
}
|
||||
} {1 {misuse of aggregate: max(b)}}
|
||||
|
||||
finish_test
|
||||
Reference in New Issue
Block a user