diff options
author | drh <drh@noemail.net> | 2014-08-05 21:31:08 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2014-08-05 21:31:08 +0000 |
commit | 1cfc9aa993ee0210d71b6c58c81f2a20c5590b7e (patch) | |
tree | 4835557afe881fe7b17ffac77b698a1137f212cf /src/expr.c | |
parent | 42191f62481ba60170809af2acde6452a9aacfcd (diff) | |
download | sqlite-1cfc9aa993ee0210d71b6c58c81f2a20c5590b7e.tar.gz sqlite-1cfc9aa993ee0210d71b6c58c81f2a20c5590b7e.zip |
Ensure that aggregate functions are not used when evaluating a default
value for a table column.
Candidate fix for ticket [3a88d85f36704eebe134f7].
FossilOrigin-Name: 29ba812825bf06ef230f2480bba0579653f0a52d
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c index e6ac84db9..9eb893d26 100644 --- a/src/expr.c +++ b/src/expr.c @@ -2768,6 +2768,11 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ 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 |