Re: BUG #13988: "plan should not reference subplan's variable" whilst using row level security
| От | Tom Lane |
|---|---|
| Тема | Re: BUG #13988: "plan should not reference subplan's variable" whilst using row level security |
| Дата | |
| Msg-id | 25223.1456448108@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: BUG #13988: "plan should not reference subplan's variable" whilst using row level security (Dean Rasheed <dean.a.rasheed@gmail.com>) |
| Ответы |
Re: BUG #13988: "plan should not reference subplan's variable"
whilst using row level security
|
| Список | pgsql-bugs |
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> Debugging it, I have a theory as to the cause of the problem, which I
> think is in security_barrier_replace_vars() --- when it finds a
> matching Var that needs to be added to the targetlist that it is
> building, it copies the existing Var and modifies it:
> /* New variable for subquery targetlist */
> newvar = copyObject(var);
> newvar->varno = newvar->varnoold = 1;
> ...
> However, the Var found comes from a sublink subquery in the outer
> query, and so has varlevelsup = 1, but newvar is for the new subquery
> being built, so it needs to have varlevelsup set to 0, which that code
> fails to do.
Offhand, I'd think it more likely that this code should not be touching
outer-level vars at all? There are few if any situations where it makes
sense to suppose that a Var of one level should be transformed into a Var
of a different level.
regards, tom lane
В списке pgsql-bugs по дате отправления: