1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

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.
This commit is contained in:
Tom Lane
2014-09-24 15:59:34 -04:00
parent b1a52872ae
commit 3f6f9260e3
2 changed files with 17 additions and 17 deletions

View File

@ -432,7 +432,7 @@ security_barrier_replace_vars_walker(Node *node,
/* New variable for subquery targetlist */
newvar = copyObject(var);
newvar->varno = 1;
newvar->varno = newvar->varnoold = 1;
attno = list_length(context->targetlist) + 1;
tle = makeTargetEntry((Expr *) newvar,