pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Need to do SPI_push/SPI_pop around expression evaluation in plpg
Date: Sun, 06 Nov 2016 17:09:47 +0000
Message-ID: <E1c3Qx1-0007DA-RH@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Need to do SPI_push/SPI_pop around expression evaluation in plpgsql.

We must do this in case the expression evaluation results in calling
another plpgsql function (or, really, anything using SPI).  I missed
the need for this when I converted exec_cast_value() from doing a
simple InputFunctionCall() to doing ExecEvalExpr() in commit 1345cc67b.
There is a SPI_push_conditional in InputFunctionCall(), so that there
was no bug before that.

Per bug #14414 from Marcos Castedo.  Add a regression test based on his
example, which was that a plpgsql function in a domain check constraint
didn't work when assigning to a domain-type variable within plpgsql.

Report: <20161106010947.1387.66380@wrigleys.postgresql.org>

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/674877e93a1b9217c692a5671e1118136959ee74

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c          |  4 ++++
src/test/regress/expected/plpgsql.out | 19 +++++++++++++++++++
src/test/regress/sql/plpgsql.sql      | 22 ++++++++++++++++++++++
3 files changed, 45 insertions(+)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (3+ messages)

Message-ID: <E1c3Qx1-0007DA-RH@gemulon.postgresql.org>
Permalink:  ../E1c3Qx1-0007DA-RH@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1c3Qx1-0007DA-RH@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Need to do SPI_push/SPI_pop around expression evaluation in plpg
  In-Reply-To: <E1c3Qx1-0007DA-RH@gemulon.postgresql.org>
  References: <E1c3Qx1-0007DA-RH@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