reset memory context at end of execution

merge-cstore-pykello
Jeff Davis 2020-09-23 22:52:44 -07:00
parent 1b45cfb52e
commit 7714b60e5e
1 changed files with 12 additions and 1 deletions

View File

@ -58,7 +58,7 @@ CStoreTableAMGetOptions(void)
static MemoryContext static MemoryContext
GetCStoreMemoryContext(void) GetCStoreMemoryContext()
{ {
if (CStoreContext == NULL) if (CStoreContext == NULL)
{ {
@ -69,6 +69,16 @@ GetCStoreMemoryContext(void)
} }
static void
ResetCStoreMemoryContext()
{
if (CStoreContext != NULL)
{
MemoryContextReset(CStoreContext);
}
}
static void static void
cstore_init_write_state(Relation relation) cstore_init_write_state(Relation relation)
{ {
@ -591,6 +601,7 @@ CStoreExecutorEnd(QueryDesc *queryDesc)
{ {
standard_ExecutorEnd(queryDesc); standard_ExecutorEnd(queryDesc);
} }
ResetCStoreMemoryContext();
} }