mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Fix illegal combination of SearchSysCacheTuple() and heap_freetuple()
in AlterTableOwner().
This commit is contained in:
parent
8f3b2b3a5c
commit
3eaf3363d7
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.110 2000/11/12 00:36:56 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.111 2000/11/14 01:57:30 inoue Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The PerformAddAttribute() code, like most of the relation
|
* The PerformAddAttribute() code, like most of the relation
|
||||||
@ -1447,14 +1447,13 @@ AlterTableOwner(const char *relationName, const char *newOwnerName)
|
|||||||
elog(ERROR, "ALTER TABLE: user \"%s\" not found", newOwnerName);
|
elog(ERROR, "ALTER TABLE: user \"%s\" not found", newOwnerName);
|
||||||
|
|
||||||
newOwnerSysid = ((Form_pg_shadow) GETSTRUCT(tuple))->usesysid;
|
newOwnerSysid = ((Form_pg_shadow) GETSTRUCT(tuple))->usesysid;
|
||||||
heap_freetuple(tuple);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* find the table's entry in pg_class and lock it for writing
|
* find the table's entry in pg_class and lock it for writing
|
||||||
*/
|
*/
|
||||||
class_rel = heap_openr(RelationRelationName, RowExclusiveLock);
|
class_rel = heap_openr(RelationRelationName, RowExclusiveLock);
|
||||||
|
|
||||||
tuple = SearchSysCacheTuple(RELNAME, PointerGetDatum(relationName),
|
tuple = SearchSysCacheTupleCopy(RELNAME, PointerGetDatum(relationName),
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
if (!HeapTupleIsValid(tuple))
|
if (!HeapTupleIsValid(tuple))
|
||||||
elog(ERROR, "ALTER TABLE: relation \"%s\" not found",
|
elog(ERROR, "ALTER TABLE: relation \"%s\" not found",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user