mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-08 03:22:21 +03:00
Change so that deleting an Expr structure requires only one frame per level in the expression tree, not two.
FossilOrigin-Name: a4380ab326e4b0de29271c824d041193e86b7139
This commit is contained in:
15
src/expr.c
15
src/expr.c
@@ -627,11 +627,10 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){
|
||||
}
|
||||
|
||||
/*
|
||||
** Clear an expression structure without deleting the structure itself.
|
||||
** Substructure is deleted.
|
||||
** Recursively delete an expression tree.
|
||||
*/
|
||||
void sqlite3ExprClear(sqlite3 *db, Expr *p){
|
||||
assert( p!=0 );
|
||||
void sqlite3ExprDelete(sqlite3 *db, Expr *p){
|
||||
if( p==0 ) return;
|
||||
if( !ExprHasAnyProperty(p, EP_TokenOnly) ){
|
||||
sqlite3ExprDelete(db, p->pLeft);
|
||||
sqlite3ExprDelete(db, p->pRight);
|
||||
@@ -644,14 +643,6 @@ void sqlite3ExprClear(sqlite3 *db, Expr *p){
|
||||
sqlite3ExprListDelete(db, p->x.pList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Recursively delete an expression tree.
|
||||
*/
|
||||
void sqlite3ExprDelete(sqlite3 *db, Expr *p){
|
||||
if( p==0 ) return;
|
||||
sqlite3ExprClear(db, p);
|
||||
if( !ExprHasProperty(p, EP_Static) ){
|
||||
sqlite3DbFree(db, p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user