aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2019-03-25 11:23:52 -0400
committerRobert Haas <rhaas@postgresql.org>2019-03-25 11:28:06 -0400
commit5857be907d5178673ce077ba71562f3c4297ee32 (patch)
tree43e0a4dfc86de5232bb83271b4020733ffc3087c /src
parent25ee70511ec2ccbef0ad3fe64875a4d552cdcd50 (diff)
downloadpostgresql-5857be907d5178673ce077ba71562f3c4297ee32.tar.gz
postgresql-5857be907d5178673ce077ba71562f3c4297ee32.zip
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
Diffstat (limited to 'src')
-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 d97781e1cbe..04cc15606d2 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 c7f3ca2a208..af3f91133ed 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++)