* Initialize the relation map cache.
*/
static void
-logicalrep_relmap_init()
+logicalrep_relmap_init(void)
{
HASHCTL ctl;
pfree(remoterel->attnames);
pfree(remoterel->atttyps);
}
- remoterel->attnames = NULL;
- remoterel->atttyps = NULL;
-
bms_free(remoterel->attkeys);
- remoterel->attkeys = NULL;
if (entry->attrmap)
pfree(entry->attrmap);
-
- entry->attrmap = NULL;
- remoterel->natts = 0;
- entry->localreloid = InvalidOid;
- entry->localrel = NULL;
}
/*
if (found)
logicalrep_relmap_free_entry(entry);
+ memset(entry, 0, sizeof(LogicalRepRelMapEntry));
+
/* Make cached copy of the data */
oldctx = MemoryContextSwitchTo(LogicalRepRelMapContext);
entry->remoterel.remoteid = remoterel->remoteid;
}
entry->remoterel.replident = remoterel->replident;
entry->remoterel.attkeys = bms_copy(remoterel->attkeys);
- entry->attrmap = NULL;
- entry->localreloid = InvalidOid;
MemoryContextSwitchTo(oldctx);
}