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

Commit030ad0a

Browse files
committed
Add check for syscache lookup failure in update_relispartition().
Omitted in commit05b38c7 (though it looks like the original blamebelongs to9e9befa). A failure is admittedly unlikely, but if itdid happen, SIGSEGV is not the approved method of reporting it.Per Coverity. Back-patch to v11 where the broken code originated.
1 parent506af10 commit030ad0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/commands/indexcmds.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2682,10 +2682,11 @@ update_relispartition(Oid relationId, bool newval)
26822682

26832683
classRel=heap_open(RelationRelationId,RowExclusiveLock);
26842684
tup=SearchSysCacheCopy1(RELOID,ObjectIdGetDatum(relationId));
2685+
if (!HeapTupleIsValid(tup))
2686+
elog(ERROR,"cache lookup failed for relation %u",relationId);
26852687
Assert(((Form_pg_class)GETSTRUCT(tup))->relispartition!=newval);
26862688
((Form_pg_class)GETSTRUCT(tup))->relispartition=newval;
26872689
CatalogTupleUpdate(classRel,&tup->t_self,tup);
26882690
heap_freetuple(tup);
2689-
26902691
heap_close(classRel,RowExclusiveLock);
26912692
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp