Avoid lost result of recursion (src/backend/optimizer/util/inherit.c)

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2022-12-21T00:14:48Z
Lists: pgsql-hackers

Attachments

Hi.

IMO, I think that commit a61b1f7
<https://github.com/postgres/postgres/commit/a61b1f74823c9c4f79c95226a461f1e7a367764b>,
has an oversight.
Currently is losing the result of recursion of function
translate_col_privs_multilevel.

Once the variable result (Bitmapset pointer) is reassigned.

Without a test case for this patch.
But also, do not have a test case for the current thinko in head.

Pass regress check.

regards,
Ranier Vilela

Commits

  1. Fix bug in translate_col_privs_multilevel

  2. Rework query relation permission checking