Commit 7431796b authored by Tom Lane's avatar Tom Lane

fix_parsetree_attnums was not nearly smart enough about walking parse

trees.  Also rewrite find_all_inheritors() in a more intelligible style.
parent 549a8ba5
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.59 1999/12/10 03:55:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.60 1999/12/14 03:35:20 tgl Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
......@@ -340,12 +340,11 @@ PerformAddAttribute(char *relationName,
{
if (inherits)
{
Oid childrelid;
List *child,
*children;
/* this routine is actually in the planner */
children = find_all_inheritors(lconsi(myrelid, NIL), NIL);
children = find_all_inheritors(myrelid);
/*
* find_all_inheritors does the recursive search of the
......@@ -354,7 +353,8 @@ PerformAddAttribute(char *relationName,
*/
foreach(child, children)
{
childrelid = lfirsti(child);
Oid childrelid = lfirsti(child);
if (childrelid == myrelid)
continue;
rel = heap_open(childrelid, AccessExclusiveLock);
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.37 1999/11/25 00:15:57 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.38 1999/12/14 03:35:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -97,7 +97,7 @@ renameatt(char *relname,
*children;
/* this routine is actually in the planner */
children = find_all_inheritors(lconsi(relid, NIL), NIL);
children = find_all_inheritors(relid);
/*
* find_all_inheritors does the recursive search of the
......@@ -106,10 +106,9 @@ renameatt(char *relname,
*/
foreach(child, children)
{
Oid childrelid;
Oid childrelid = lfirsti(child);
char childname[NAMEDATALEN];
childrelid = lfirsti(child);
if (childrelid == relid)
continue;
reltup = SearchSysCacheTuple(RELOID,
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: prep.h,v 1.19 1999/09/13 00:17:08 tgl Exp $
* $Id: prep.h,v 1.20 1999/12/14 03:35:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -32,8 +32,7 @@ extern List *preprocess_targetlist(List *tlist, int command_type,
/*
* prototypes for prepunion.c
*/
extern List *find_all_inheritors(List *unexamined_relids,
List *examined_relids);
extern List *find_all_inheritors(Oid parentrel);
extern int first_inherit_rt_entry(List *rangetable);
extern Append *plan_union_queries(Query *parse);
extern Append *plan_inherit_queries(Query *parse, List *tlist, Index rt_index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment