pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Collect the global OR of hasRowSecurity flags for plancache
Date: Tue, 15 Dec 2015 01:06:07 +0000
Message-ID: <E1a8e47-0000mK-Uh@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Collect the global OR of hasRowSecurity flags for plancache

We carry around information about if a given query has row security or
not to allow the plancache to use that information to invalidate a
planned query in the event that the environment changes.

Previously, the flag of one of the subqueries was simply being copied
into place to indicate if the query overall included RLS components.
That's wrong as we need the global OR of all subqueries.  Fix by
changing the code to match how fireRIRules works, which is results
in OR'ing all of the flags.

Noted by Tom.

Back-patch to 9.5 where RLS was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e5e11c8cca7ae298895430102217fa6d77cfb2a3

Modified Files
--------------
src/backend/optimizer/plan/planner.c      |    3 +-
src/backend/optimizer/plan/setrefs.c      |    3 +-
src/test/regress/expected/rowsecurity.out |  154 ++++++++++++++++++++++++++++-
src/test/regress/sql/rowsecurity.sql      |   24 ++++-
4 files changed, 180 insertions(+), 4 deletions(-)


-- 
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 (2+ messages)  latest in thread

Message-ID: <E1a8e47-0000mK-Uh@gemulon.postgresql.org>
Permalink:  ../E1a8e47-0000mK-Uh@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1a8e47-0000mK-Uh@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: sfrost@snowman.net
  Subject: Re: pgsql: Collect the global OR of hasRowSecurity flags for plancache
  In-Reply-To: <E1a8e47-0000mK-Uh@gemulon.postgresql.org>
  References: <E1a8e47-0000mK-Uh@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