From 5857be907d5178673ce077ba71562f3c4297ee32 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Mon, 25 Mar 2019 11:23:52 -0400 Subject: [PATCH] Fix use of wrong datatype with sizeof(). OID and int are the same size, but they are not the same thing. David Rowley Discussion: http://postgr.es/m/CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com --- src/backend/nodes/copyfuncs.c | 2 +- src/backend/partitioning/partprune.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index d97781e1cb..04cc15606d 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -1204,7 +1204,7 @@ _copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from) COPY_SCALAR_FIELD(nexprs); COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int)); COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int)); - COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(int)); + COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(Oid)); COPY_POINTER_FIELD(hasexecparam, from->nexprs * sizeof(bool)); COPY_SCALAR_FIELD(do_initial_prune); COPY_SCALAR_FIELD(do_exec_prune); diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c index c7f3ca2a20..af3f91133e 100644 --- a/src/backend/partitioning/partprune.c +++ b/src/backend/partitioning/partprune.c @@ -475,7 +475,7 @@ make_partitionedrel_pruneinfo(PlannerInfo *root, RelOptInfo *parentrel, */ subplan_map = (int *) palloc(nparts * sizeof(int)); subpart_map = (int *) palloc(nparts * sizeof(int)); - relid_map = (Oid *) palloc(nparts * sizeof(int)); + relid_map = (Oid *) palloc(nparts * sizeof(Oid)); present_parts = NULL; for (i = 0; i < nparts; i++) -- 2.50.1