Skip to content

Commit 7431796

Browse files
committed
fix_parsetree_attnums was not nearly smart enough about walking parse
trees. Also rewrite find_all_inheritors() in a more intelligible style.
1 parent 549a8ba commit 7431796

File tree

4 files changed

+158
-139
lines changed

4 files changed

+158
-139
lines changed

src/backend/commands/command.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.59 1999/12/10 03:55:49 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.60 1999/12/14 03:35:20 tgl Exp $
1111
*
1212
* NOTES
1313
* The PortalExecutorHeapMemory crap needs to be eliminated
@@ -340,12 +340,11 @@ PerformAddAttribute(char *relationName,
340340
{
341341
if (inherits)
342342
{
343-
Oid childrelid;
344343
List *child,
345344
*children;
346345

347346
/* this routine is actually in the planner */
348-
children = find_all_inheritors(lconsi(myrelid, NIL), NIL);
347+
children = find_all_inheritors(myrelid);
349348

350349
/*
351350
* find_all_inheritors does the recursive search of the
@@ -354,7 +353,8 @@ PerformAddAttribute(char *relationName,
354353
*/
355354
foreach(child, children)
356355
{
357-
childrelid = lfirsti(child);
356+
Oid childrelid = lfirsti(child);
357+
358358
if (childrelid == myrelid)
359359
continue;
360360
rel = heap_open(childrelid, AccessExclusiveLock);

src/backend/commands/rename.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.37 1999/11/25 00:15:57 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.38 1999/12/14 03:35:20 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -97,7 +97,7 @@ renameatt(char *relname,
9797
*children;
9898

9999
/* this routine is actually in the planner */
100-
children = find_all_inheritors(lconsi(relid, NIL), NIL);
100+
children = find_all_inheritors(relid);
101101

102102
/*
103103
* find_all_inheritors does the recursive search of the
@@ -106,10 +106,9 @@ renameatt(char *relname,
106106
*/
107107
foreach(child, children)
108108
{
109-
Oid childrelid;
109+
Oid childrelid = lfirsti(child);
110110
char childname[NAMEDATALEN];
111111

112-
childrelid = lfirsti(child);
113112
if (childrelid == relid)
114113
continue;
115114
reltup = SearchSysCacheTuple(RELOID,

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