1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Ensure that aggregate functions are not used when evaluating a default

value for a table column.
Candidate fix for ticket [3a88d85f36704eebe134f7].

FossilOrigin-Name: 29ba812825bf06ef230f2480bba0579653f0a52d
This commit is contained in:
drh
2014-08-05 21:31:08 +00:00
parent 42191f6248
commit 1cfc9aa993
4 changed files with 59 additions and 9 deletions

View File

@@ -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