mirror of
https://github.com/postgres/postgres.git
synced 2026-03-03 05:40:43 -05:00
Remove NULL dereference from RenameRelationInternal().
Defect in last week's commit aac2c9b4fd,
per Coverity. Reaching this would need catalog corruption. Back-patch
to v12, like that commit.
This commit is contained in:
parent
e9339782a6
commit
0d5a3d7574
1 changed files with 1 additions and 1 deletions
|
|
@ -4132,9 +4132,9 @@ RenameRelationInternal(Oid myrelid, const char *newrelname, bool is_internal, bo
|
|||
relrelation = table_open(RelationRelationId, RowExclusiveLock);
|
||||
|
||||
reltup = SearchSysCacheLockedCopy1(RELOID, ObjectIdGetDatum(myrelid));
|
||||
otid = reltup->t_self;
|
||||
if (!HeapTupleIsValid(reltup)) /* shouldn't happen */
|
||||
elog(ERROR, "cache lookup failed for relation %u", myrelid);
|
||||
otid = reltup->t_self;
|
||||
relform = (Form_pg_class) GETSTRUCT(reltup);
|
||||
|
||||
if (get_relname_relid(newrelname, namespaceId) != InvalidOid)
|
||||
|
|
|
|||
Loading…
Reference in a new issue