Skip to content

Commit 3eaf336

Browse files
author
Hiroshi Inoue
committed
Fix illegal combination of SearchSysCacheTuple() and heap_freetuple()
in AlterTableOwner().
1 parent 8f3b2b3 commit 3eaf336

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/commands/command.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.110 2000/11/12 00:36:56 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.111 2000/11/14 01:57:30 inoue Exp $
1212
*
1313
* NOTES
1414
* The PerformAddAttribute() code, like most of the relation
@@ -1447,14 +1447,13 @@ AlterTableOwner(const char *relationName, const char *newOwnerName)
14471447
elog(ERROR, "ALTER TABLE: user \"%s\" not found", newOwnerName);
14481448

14491449
newOwnerSysid = ((Form_pg_shadow) GETSTRUCT(tuple))->usesysid;
1450-
heap_freetuple(tuple);
14511450

14521451
/*
14531452
* find the table's entry in pg_class and lock it for writing
14541453
*/
14551454
class_rel = heap_openr(RelationRelationName, RowExclusiveLock);
14561455

1457-
tuple = SearchSysCacheTuple(RELNAME, PointerGetDatum(relationName),
1456+
tuple = SearchSysCacheTupleCopy(RELNAME, PointerGetDatum(relationName),
14581457
0, 0, 0);
14591458
if (!HeapTupleIsValid(tuple))
14601459
elog(ERROR, "ALTER TABLE: relation \"%s\" not found",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy