aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-08-06 00:29:06 +0000
committerdrh <drh@noemail.net>2014-08-06 00:29:06 +0000
commit0c4de2d96de879f19e4ff8f952a82713c9a9c18b (patch)
treefeb19514f5e5ab7bc512988e9b4f8c2635ecfe38 /src/expr.c
parent1cfc9aa993ee0210d71b6c58c81f2a20c5590b7e (diff)
downloadsqlite-0c4de2d96de879f19e4ff8f952a82713c9a9c18b.tar.gz
sqlite-0c4de2d96de879f19e4ff8f952a82713c9a9c18b.zip
A simpler fix for ticket [3a88d85f36704eebe1] - one that uses less code.
The error message is not quite as good, but as this error has apparently not previously occurred in over 8 years of heavy use, that is not seen as a serious problem. FossilOrigin-Name: 0ad1ed8ef0b5fb5d8db44479373b2b93d8fcfd66
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/expr.c b/src/expr.c
index 9eb893d26..0d2292e94 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -2764,15 +2764,10 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
zId = pExpr->u.zToken;
nId = sqlite3Strlen30(zId);
pDef = sqlite3FindFunction(db, zId, nId, nFarg, enc, 0);
- if( pDef==0 ){
+ if( pDef==0 || pDef->xFunc==0 ){
sqlite3ErrorMsg(pParse, "unknown function: %.*s()", nId, zId);
break;
}
- if( pDef->xFunc==0 ){
- sqlite3ErrorMsg(pParse, "misuse of aggregate function: %.*s()",
- nId, zId);
- break;
- }
/* Attempt a direct implementation of the built-in COALESCE() and
** IFNULL() functions. This avoids unnecessary evalation of