pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix plan cache issue in PL/pgSQL CALL
Date: Thu, 05 Apr 2018 18:56:23 +0000
Message-ID: <E1f4A3b-0004FQ-0m@gemulon.postgresql.org> (raw)

Fix plan cache issue in PL/pgSQL CALL

If we are not going to save the plan, then we need to unset expr->plan
after we are done, also in error cases.  Otherwise, we get a dangling
pointer next time around.

This is not the ideal solution.  It would be better if we could convince
SPI not to associate a cached plan with a resource owner, and then we
could just save the plan in all cases.  But that would require bigger
surgery.

Reported-by: Pavel Stehule <pavel.stehule@gmail.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b9986551e0c6129300b9d7a387baf2006724b297

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_call.out | 10 ++++++++++
src/pl/plpgsql/src/pl_exec.c                 | 30 ++++++++++++++++++++++++----
src/pl/plpgsql/src/sql/plpgsql_call.sql      |  4 ++++
3 files changed, 40 insertions(+), 4 deletions(-)



Message-ID: <E1f4A3b-0004FQ-0m@gemulon.postgresql.org>
Permalink:  ../E1f4A3b-0004FQ-0m@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f4A3b-0004FQ-0m@gemulon.postgresql.org

 · 

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: peter_e@gmx.net
  Subject: Re: pgsql: Fix plan cache issue in PL/pgSQL CALL
  In-Reply-To: <E1f4A3b-0004FQ-0m@gemulon.postgresql.org>
  References: <E1f4A3b-0004FQ-0m@gemulon.postgresql.org>

* 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