Merge pull request #12 from citusdata/memcxt

reset memory context at end of execution
merge-cstore-pykello
Hadi Moshayedi 2020-09-26 23:37:09 -07:00 committed by GitHub
commit d352a987fa
1 changed files with 12 additions and 1 deletions

View File

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