Skip to content

Commit 5857be9

Browse files
committed
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
1 parent 25ee705 commit 5857be9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/nodes/copyfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ _copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from)
12041204
COPY_SCALAR_FIELD(nexprs);
12051205
COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int));
12061206
COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int));
1207-
COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(int));
1207+
COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(Oid));
12081208
COPY_POINTER_FIELD(hasexecparam, from->nexprs * sizeof(bool));
12091209
COPY_SCALAR_FIELD(do_initial_prune);
12101210
COPY_SCALAR_FIELD(do_exec_prune);

src/backend/partitioning/partprune.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ make_partitionedrel_pruneinfo(PlannerInfo *root, RelOptInfo *parentrel,
475475
*/
476476
subplan_map = (int *) palloc(nparts * sizeof(int));
477477
subpart_map = (int *) palloc(nparts * sizeof(int));
478-
relid_map = (Oid *) palloc(nparts * sizeof(int));
478+
relid_map = (Oid *) palloc(nparts * sizeof(Oid));
479479
present_parts = NULL;
480480

481481
for (i = 0; i < nparts; i++)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy