mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
Use sqliteErrorMsg instead of sqliteSetString whereever practical. (CVS 1264)
FossilOrigin-Name: 69aac043af7f93e7b3f036622c0ac9261cae1839
This commit is contained in:
20
src/expr.c
20
src/expr.c
@@ -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.109 2004/02/21 19:17:18 drh Exp $
|
||||
** $Id: expr.c,v 1.110 2004/02/22 18:40:57 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@@ -847,23 +847,21 @@ int sqliteExprCheck(Parse *pParse, Expr *pExpr, int allowAgg, int *pIsAgg){
|
||||
is_agg = pDef->xFunc==0;
|
||||
}
|
||||
if( is_agg && !allowAgg ){
|
||||
sqliteSetNString(&pParse->zErrMsg, "misuse of aggregate function ", -1,
|
||||
zId, nId, "()", 2, 0);
|
||||
pParse->nErr++;
|
||||
sqliteErrorMsg(pParse, "misuse of aggregate function %.*s()", nId, zId);
|
||||
nErr++;
|
||||
is_agg = 0;
|
||||
}else if( no_such_func ){
|
||||
sqliteSetNString(&pParse->zErrMsg, "no such function: ", -1, zId,nId,0);
|
||||
pParse->nErr++;
|
||||
sqliteErrorMsg(pParse, "no such function: %.*s", nId, zId);
|
||||
nErr++;
|
||||
}else if( wrong_num_args ){
|
||||
sqliteSetNString(&pParse->zErrMsg,
|
||||
"wrong number of arguments to function ", -1, zId, nId, "()", 2, 0);
|
||||
pParse->nErr++;
|
||||
sqliteErrorMsg(pParse,"wrong number of arguments to function %.*s()",
|
||||
nId, zId);
|
||||
nErr++;
|
||||
}
|
||||
if( is_agg ) pExpr->op = TK_AGG_FUNCTION;
|
||||
if( is_agg && pIsAgg ) *pIsAgg = 1;
|
||||
if( is_agg ){
|
||||
pExpr->op = TK_AGG_FUNCTION;
|
||||
if( pIsAgg ) *pIsAgg = 1;
|
||||
}
|
||||
for(i=0; nErr==0 && i<n; i++){
|
||||
nErr = sqliteExprCheck(pParse, pExpr->pList->a[i].pExpr,
|
||||
allowAgg && !is_agg, pIsAgg);
|
||||
|
||||
Reference in New Issue
Block a user