1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

AggInfo objects might be referenced even after the sqlite3Select() function

that created them has exited.  So AggInfo cannot be a stack variable.  And it
must not be freed until the Parse object is destroyed.

FossilOrigin-Name: 3c840b4df306e2db1da08673e9ede973b4cb6d2b3f9eeeab5835e39452ee3056
This commit is contained in:
drh
2020-06-07 20:18:07 +00:00
parent 896366282d
commit bf7909734a
7 changed files with 103 additions and 84 deletions

View File

@@ -2526,6 +2526,7 @@ struct AggInfo {
#ifdef SQLITE_DEBUG
int iAggMagic; /* Magic number when valid */
#endif
AggInfo *pNext; /* Next in list of them all */
};
/*
@@ -3329,6 +3330,7 @@ struct Parse {
Parse *pToplevel; /* Parse structure for main program (or NULL) */
Table *pTriggerTab; /* Table triggers are being coded for */
Parse *pParentParse; /* Parent parser if this parser is nested */
AggInfo *pAggList; /* List of all AggInfo objects */
int addrCrTab; /* Address of OP_CreateBtree opcode on CREATE TABLE */
u32 nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
u32 oldmask; /* Mask of old.* columns referenced */