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

Commit6d554e3

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 parent62e2809 commit6d554e3

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
@@ -657,6 +657,8 @@ AlterStatistics(AlterStatsStmt *stmt)
657657
rel=table_open(StatisticExtRelationId,RowExclusiveLock);
658658

659659
oldtup=SearchSysCache1(STATEXTOID,ObjectIdGetDatum(stxoid));
660+
if (!HeapTupleIsValid(oldtup))
661+
elog(ERROR,"cache lookup failed for extended statistics object %u",stxoid);
660662

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp