Re: Bug fix for cache lookup failure for statistic_ext type - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: Bug fix for cache lookup failure for statistic_ext type
Date
Msg-id 02ad87e7-5742-8633-50f1-6f95067ebbb7@enterprisedb.com
Whole thread Raw
In response to Bug fix for cache lookup failure for statistic_ext type  (Mark Dilger <mark.dilger@enterprisedb.com>)
Responses Re: Bug fix for cache lookup failure for statistic_ext type
List pgsql-hackers
On 8/5/21 12:03 AM, Mark Dilger wrote:
> Hackers,
> 
> You can easily get a cache lookup failure by changing the regression tests as included in this small patch.  The
failurelooks thus:
 
> 
> +COMMENT ON STATISTICS ab1_a_b_stats IS 'new comment';
> +CREATE ROLE temp_role;
> +SET SESSION AUTHORIZATION temp_role;
> +COMMENT ON STATISTICS ab1_a_b_stats IS 'changed comment';
> +ERROR:  cache lookup failed for type 27447
> +DROP STATISTICS ab1_a_b_stats;
> +ERROR:  cache lookup failed for type 27447
> +ALTER STATISTICS ab1_a_b_stats RENAME TO ab1_a_b_stats_new;
> +ERROR:  must be owner of statistics object ab1_a_b_stats
> +RESET SESSION AUTHORIZATION;
> +DROP ROLE temp_role;
> 
> I believe this case simply has not had any test coverage, as I don't
> see any way the current code would ever work.  It treats the Oid of the
> statistics object as a type, which it is not.
> 

Yeah, you're right - this is broken since 7b504eb282c. Thanks for the 
fix, I'll get it committed.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Lowering the ever-growing heap->pd_lower
Next
From: Andres Freund
Date:
Subject: Re: A varint implementation for PG?