Ensure that aggregate functions are not used when evaluating a default
value for a table column.
Candidate fix for ticket [3a88d85f36704eebe134f7].
FossilOrigin-Name: 29ba812825bf06ef230f2480bba0579653f0a52d
diff --git a/src/expr.c b/src/expr.c
index e6ac84d..9eb893d 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -2768,6 +2768,11 @@
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