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

Commit62148c3

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 parent84e4570 commit62148c3

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
@@ -3451,10 +3451,11 @@ update_relispartition(Oid relationId, bool newval)
34513451

34523452
classRel=table_open(RelationRelationId,RowExclusiveLock);
34533453
tup=SearchSysCacheCopy1(RELOID,ObjectIdGetDatum(relationId));
3454+
if (!HeapTupleIsValid(tup))
3455+
elog(ERROR,"cache lookup failed for relation %u",relationId);
34543456
Assert(((Form_pg_class)GETSTRUCT(tup))->relispartition!=newval);
34553457
((Form_pg_class)GETSTRUCT(tup))->relispartition=newval;
34563458
CatalogTupleUpdate(classRel,&tup->t_self,tup);
34573459
heap_freetuple(tup);
3458-
34593460
table_close(classRel,RowExclusiveLock);
34603461
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp