The previous code was allocating more memory than necessary because
the formula used the wrong data type.
Reported-by: Jehan-Guillaume de Rorthais <[email protected]>
Discussion: https://www.postgresql.org/message-id/
20191105172918.
3e32a446@firost
*/
desc = RelationGetDescr(entry->localrel);
oldctx = MemoryContextSwitchTo(LogicalRepRelMapContext);
- entry->attrmap = palloc(desc->natts * sizeof(int));
+ entry->attrmap = palloc(desc->natts * sizeof(AttrNumber));
MemoryContextSwitchTo(oldctx);
found = 0;