8000 Fix use of wrong datatype with sizeof(). · postgrespro/postgres_cluster@5857be9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5857be9

Browse files
committed
< 10000 span class="ws-pre-wrap f5 wb-break-word text-mono prc-Text-Text-0ima0">
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)
0