Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita192243

Browse files
committed
Check syscache result in AlterStatistics
The syscache lookup may return NULL even for valid OID, for example dueto a concurrent DROP STATISTICS, so a HeapTupleIsValid is necessary.Without it, it may fail with a segfault.Reported by Alexander Lakhin, patch by me. Backpatch to 13, where ALTERSTATISTICS ... SET STATISTICS was introduced.Backpatch-through: 13Discussion:https://postgr.es/m/17372-bf3b6e947e35ae77%40postgresql.org
1 parent3839e29 commita192243

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/backend/commands/statscmds.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,8 @@ AlterStatistics(AlterStatsStmt *stmt)
677677
rel=table_open(StatisticExtRelationId,RowExclusiveLock);
678678

679679
oldtup=SearchSysCache1(STATEXTOID,ObjectIdGetDatum(stxoid));
680+
if (!HeapTupleIsValid(oldtup))
681+
elog(ERROR,"cache lookup failed for extended statistics object %u",stxoid);
680682

681683
/* Must be owner of the existing statistics object */
682684
if (!pg_statistics_object_ownercheck(stxoid,GetUserId()))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp