1
0
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:
drh
2005-11-16 12:53:15 +00:00
parent ed2df7fb68
commit 7e56e71125
4 changed files with 42 additions and 9 deletions

View File

@@ -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;
sqlite3VdbeAddOp(v, OP_MemLoad, pInfo->aFunc[pExpr->iAgg].iMem, 0);
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: