pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <david.rowley@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Allow ATTACH PARTITION with only ShareUpdateExclusiveLock.
Date: Sat, 23 Mar 2019 02:21:45 +1300
Message-ID: <CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com> (raw)
In-Reply-To: <E1h1w3M-0004ZE-Kt@gemulon.postgresql.org>
References: <E1h1w3M-0004ZE-Kt@gemulon.postgresql.org>

On Fri, 8 Mar 2019 at 05:39, Robert Haas <rhaas@postgresql.org> wrote:
> src/backend/partitioning/partprune.c   |   7 +-

I've attached a small patch that fixes a couple of incorrect sizeof()
calculations new in this commit.

Perhaps only a problem if sizeof(int) is not the same as sizeof(Oid),
but incorrect never-the-less.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

fixup_sizeof_relid_map.patch (application/octet-stream, 1.2K) download diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 1ea6b84561..d5ae9469a1 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 31e0164ea9..6d67c428fe 100644 --- a/src/backend/partitioning/partprune.c +++ b/src/backend/partitioning/partprune.c @@ -436,7 +436,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++)

view thread (3+ messages)  latest in thread

Message-ID: <CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com>
Permalink:  ../CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com/
Also on:    postgresql.org/message-id/CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: david.rowley@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: pgsql: Allow ATTACH PARTITION with only ShareUpdateExclusiveLock.
  In-Reply-To: <CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com>
  References: <E1h1w3M-0004ZE-Kt@gemulon.postgresql.org> <CAKJS1f_MhS++XngkTvWL9X1v8M5t-0N0B-R465yHQY=TmNV0Ew@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox