1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-11 12:22:51 +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:
dan
2009-11-23 14:39:14 +00:00
parent fc7e7c7c84
commit f6963f99dd
5 changed files with 20 additions and 34 deletions

View File

@@ -87,7 +87,13 @@ static void resolveAlias(
pDup->pColl = pExpr->pColl;
pDup->flags |= EP_ExpCollate;
}
sqlite3ExprClear(db, pExpr);
/* Before calling sqlite3ExprDelete(), set the EP_Static flag. This
** prevents ExprDelete() from deleting the Expr structure itself,
** allowing it to be repopulated by the memcpy() on the following line.
*/
ExprSetProperty(pExpr, EP_Static);
sqlite3ExprDelete(db, pExpr);
memcpy(pExpr, pDup, sizeof(*pExpr));
sqlite3DbFree(db, pDup);
}