[COMMITTERS] pgsql: Fix confusion about number of subplans in partitioned INSERTset - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Fix confusion about number of subplans in partitioned INSERTset
Date
Msg-id E1dKcWr-00045a-NF@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix confusion about number of subplans in partitioned INSERT setup.

ExecInitModifyTable() thought there was a plan per partition, but no,
there's only one.  The problem had escaped detection so far because there
would only be visible misbehavior if there were a SubPlan (not an InitPlan)
in the quals being duplicated for each partition.  However, valgrind
detected a bogus memory access in test cases added by commit 4f7a95be2,
and investigation of that led to discovery of the bug.  The additional
test case added here crashes without the patch.

Patch by Amit Langote, test case by me.

Discussion: https://postgr.es/m/10974.1497227727@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/78a030a441966d91bc7e932ef84da39c3ea7d970

Modified Files
--------------
src/backend/executor/nodeModifyTable.c    | 21 ++++++++++++++++-----
src/test/regress/expected/rowsecurity.out |  8 ++++++++
src/test/regress/sql/rowsecurity.sql      |  9 +++++++++
3 files changed, 33 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: [COMMITTERS] pgsql: pg_dump: Fix harmless type mixup
Next
From: Amit Langote
Date:
Subject: Re: [COMMITTERS] pgsql: Apply RLS policies to partitioned tables.