summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas2019-03-25 15:23:52 +0000
committerRobert Haas2019-03-25 15:28:06 +0000
commit5857be907d5178673ce077ba71562f3c4297ee32 (patch)
tree43e0a4dfc86de5232bb83271b4020733ffc3087c
parent25ee70511ec2ccbef0ad3fe64875a4d552cdcd50 (diff)
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
-rw-r--r--src/backend/nodes/copyfuncs.c2
-rw-r--r--src/backend/partitioning/partprune.c2
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++)