pgsql: Fix bogus variable-mangling in security_barrier_replace_vars().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix bogus variable-mangling in security_barrier_replace_vars().
Date: 2014-09-24 19:59:44
Message-ID: E1XWsj2-0006Jh-Te@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix bogus variable-mangling in security_barrier_replace_vars().

This function created new Vars with varno different from varnoold, which
is a condition that should never prevail before setrefs.c does the final
variable-renumbering pass. The created Vars could not be seen as equal()
to normal Vars, which among other things broke equivalence-class processing
for them. The consequences of this were indeed visible in the regression
tests, in the form of failure to propagate constants as one would expect.
I stumbled across it while poking at bug #11457 --- after intentionally
disabling join equivalence processing, the security-barrier regression
tests started falling over with fun errors like "could not find pathkey
item to sort", because of failure to match the corrupted Vars to normal
ones.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/54b8ed6c24736d7ad55f56dbaa2696ae05c4bded

Modified Files
--------------
src/backend/optimizer/prep/prepsecurity.c | 2 +-
src/test/regress/expected/updatable_views.out | 32 ++++++++++++-------------
2 files changed, 17 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2014-09-24 20:33:54 pgsql: Code review for row security.
Previous Message Andrew Dunstan 2014-09-24 15:25:44 pgsql: Fix typos in descriptions of json_object functions.