]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix lookup error in extended stats ownership check
authorTomas Vondra <tomas.vondra@postgresql.org>
Tue, 31 Aug 2021 16:03:05 +0000 (18:03 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Tue, 31 Aug 2021 16:44:36 +0000 (18:44 +0200)
commitbfb732c0e849705a04c7c07800edf7f407742f9f
tree24429e36f1968aed5180fadff9a1414171f4e536
parent02797ffa9a31db63a6cd499c67700c0de4863e4c
Fix lookup error in extended stats ownership check

When an ownership check on extended statistics object failed, the code
was calling aclcheck_error_type to report the failure, which is clearly
wrong, resulting in cache lookup errors. Fix by calling aclcheck_error.

This issue exists since the introduction of extended statistics, so
backpatch all the way back to PostgreSQL 10. It went unnoticed because
there were no tests triggering the error, so add one.

Reported-by: Mark Dilger
Backpatch-through: 10, where extended stats were introduced
Discussion: https://postgr.es/m/1F238937-7CC2-4703-A1B1-6DC225B8978A%40enterprisedb.com
src/backend/catalog/objectaddress.c
src/test/regress/expected/stats_ext.out
src/test/regress/sql/stats_ext.sql