Skip to content

Commit

Permalink
Fix: initialize entry->snapname to NULL.
Browse files Browse the repository at this point in the history
And free tupleDesc and close table on commit transcation.
  • Loading branch information
yjhjstz authored and my-ship-it committed Aug 8, 2024
1 parent d0add48 commit 841c603
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/backend/commands/matview.c
Original file line number Diff line number Diff line change
Expand Up @@ -3301,19 +3301,6 @@ clean_up_IVM_hash_entry(MV_TriggerHashEntry *entry, bool is_abort)
list_free(table->new_tuplestores);
table->new_tuplestores = NIL;
}
if (!is_abort)
{
if (table->slot)
{
ExecDropSingleTupleTableSlot(table->slot);
table->slot = NULL;
}
if (table->rel)
{
table_close(table->rel, NoLock);
table->rel = NULL;
}
}
}

if (entry->tables)
Expand Down Expand Up @@ -3482,6 +3469,7 @@ AddPreassignedMVEntry(Oid matview_id, Oid table_id, const char* snapname)
entry->has_new = false;
entry->pid = MyProcPid;
entry->snapshot = NULL;
entry->snapname = NULL;
}

/* Switch to the new resource owner and memory context */
Expand Down

0 comments on commit 841c603

Please sign in to comment.