pgsql: Correctly set userid of subquery relations' child rels

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема pgsql: Correctly set userid of subquery relations' child rels
Дата
Msg-id E1pU7su-0026K0-6e@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Correctly set userid of subquery relations' child rels

The RelOptInfo->userid field (the user ID to check permissions as) of an
"otherrel" relation was being copied from its parent relation, which is
correct in most cases but wrong when the parent is a subquery.  In that
case, using the value from the RTEPermissionInfo of the child itself is
the appropriate thing to do.

Coming up with a test case where user-visible behavior changes proves
hard enough, so we don't add one here.

Bug introduced by a61b1f74823c, discovered by Amit while reviewing
nearby code.

Author: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/CA+HiwqE0WY_AhLnGtTsY7eYebG212XWbM-D8gr2A_ToOHyCywQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a316a3bc6d3f57e3fe0d287d11eb4f114388b1b6

Modified Files
--------------
src/backend/optimizer/util/relnode.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: pgsql: Optimize generate_orderedappend_paths
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Add assert checking to pg_leftmost_one_pos32() and friends