aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <>2022-12-17 22:10:05 +0000
committerdrh <>2022-12-17 22:10:05 +0000
commitb7959e3419757cb9d0b0a33f9715accc873f7a5e (patch)
tree5b4ca057b6681bfbbadd506ff1ad8a3e09a91881 /src/expr.c
parent88fbe16154c2f5dd551e13d9dab03915640a523e (diff)
downloadsqlite-b7959e3419757cb9d0b0a33f9715accc873f7a5e.tar.gz
sqlite-b7959e3419757cb9d0b0a33f9715accc873f7a5e.zip
Fix an unnecessarily restrictive assert() in the aggregate logic.
dbsqlfuzz 699bee2aa26c5dc84afabf6894685c316d936485 FossilOrigin-Name: 8cc0af81ad03ac65f230d78cf97e1448c2d93d556467ea3ef700d5abd4a3890c
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/expr.c b/src/expr.c
index b1ccde4af..d12457a81 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -6247,10 +6247,8 @@ int sqlite3ReferencesSrcList(Parse *pParse, Expr *pExpr, SrcList *pSrcList){
** it does, make a copy. This is done because the pExpr argument is
** subject to change.
**
-** The copy is stored on pParse->pConstExpr with a register number of 0.
-** This will cause the expression to be deleted automatically when the
-** Parse object is destroyed, but the zero register number means that it
-** will not generate any code in the preamble.
+** The copy is scheduled for deletion using the sqlite3ExprDeferredDelete()
+** which builds on the sqlite3ParserAddCleanup() mechanism.
*/
static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
if( ALWAYS(!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced))
@@ -6261,7 +6259,6 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
Parse *pParse = pWalker->pParse;
sqlite3 *db = pParse->db;
if( pExpr->op!=TK_AGG_FUNCTION ){
- assert( pExpr->op==TK_AGG_COLUMN || pExpr->op==TK_IF_NULL_ROW );
assert( iAgg>=0 && iAgg<pAggInfo->nColumn );
if( pAggInfo->aCol[iAgg].pCExpr==pExpr ){
pExpr = sqlite3ExprDup(db, pExpr, 0);