mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +03:00
Remove Ident nodetype in favor of using String nodes; this fixes some
latent wrong-struct-type bugs and makes the coding style more uniform, since the majority of places working with lists of column names were already using Strings not Idents. While at it, remove vestigial support for Stream node type, and otherwise-unreferenced nodes.h entries for T_TupleCount and T_BaseNode. NB: full recompile is recommended due to changes of Node type numbers. This shouldn't force an initdb though.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.203 2002/08/19 00:40:14 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.204 2002/08/19 15:08:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1435,28 +1435,6 @@ _copyJoinInfo(JoinInfo *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static Stream *
|
||||
_copyStream(Stream *from)
|
||||
{
|
||||
Stream *newnode = makeNode(Stream);
|
||||
|
||||
newnode->pathptr = from->pathptr;
|
||||
newnode->cinfo = from->cinfo;
|
||||
newnode->clausetype = from->clausetype;
|
||||
|
||||
newnode->upstream = (StreamPtr) NULL; /* only copy nodes
|
||||
* downwards! */
|
||||
Node_Copy(from, newnode, downstream);
|
||||
if (newnode->downstream)
|
||||
((Stream *) newnode->downstream)->upstream = (Stream *) newnode;
|
||||
|
||||
newnode->groupup = from->groupup;
|
||||
newnode->groupcost = from->groupcost;
|
||||
newnode->groupsel = from->groupsel;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/* ****************************************************************
|
||||
* parsenodes.h copy functions
|
||||
* ****************************************************************
|
||||
@@ -1593,16 +1571,6 @@ _copyAConst(A_Const *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static Ident *
|
||||
_copyIdent(Ident *from)
|
||||
{
|
||||
Ident *newnode = makeNode(Ident);
|
||||
|
||||
newnode->name = pstrdup(from->name);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static FuncCall *
|
||||
_copyFuncCall(FuncCall *from)
|
||||
{
|
||||
@@ -2890,9 +2858,6 @@ copyObject(void *from)
|
||||
case T_JoinInfo:
|
||||
retval = _copyJoinInfo(from);
|
||||
break;
|
||||
case T_Stream:
|
||||
retval = _copyStream(from);
|
||||
break;
|
||||
case T_IndexOptInfo:
|
||||
retval = _copyIndexOptInfo(from);
|
||||
break;
|
||||
@@ -3131,9 +3096,6 @@ copyObject(void *from)
|
||||
case T_A_Const:
|
||||
retval = _copyAConst(from);
|
||||
break;
|
||||
case T_Ident:
|
||||
retval = _copyIdent(from);
|
||||
break;
|
||||
case T_FuncCall:
|
||||
retval = _copyFuncCall(from);
|
||||
break;
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.152 2002/08/19 00:40:14 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.153 2002/08/19 15:08:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -543,26 +543,6 @@ _equalJoinInfo(JoinInfo *a, JoinInfo *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalStream(Stream *a, Stream *b)
|
||||
{
|
||||
if (a->clausetype != b->clausetype)
|
||||
return false;
|
||||
if (a->groupup != b->groupup)
|
||||
return false;
|
||||
if (a->groupcost != b->groupcost)
|
||||
return false;
|
||||
if (a->groupsel != b->groupsel)
|
||||
return false;
|
||||
if (!equal(a->pathptr, b->pathptr))
|
||||
return false;
|
||||
if (!equal(a->cinfo, b->cinfo))
|
||||
return false;
|
||||
if (!equal(a->upstream, b->upstream))
|
||||
return false;
|
||||
return equal(a->downstream, b->downstream);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stuff from parsenodes.h
|
||||
*/
|
||||
@@ -1556,15 +1536,6 @@ _equalAConst(A_Const *a, A_Const *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalIdent(Ident *a, Ident *b)
|
||||
{
|
||||
if (!equalstr(a->name, b->name))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalFuncCall(FuncCall *a, FuncCall *b)
|
||||
{
|
||||
@@ -2045,9 +2016,6 @@ equal(void *a, void *b)
|
||||
case T_JoinInfo:
|
||||
retval = _equalJoinInfo(a, b);
|
||||
break;
|
||||
case T_Stream:
|
||||
retval = _equalStream(a, b);
|
||||
break;
|
||||
case T_TidPath:
|
||||
retval = _equalTidPath(a, b);
|
||||
break;
|
||||
@@ -2290,9 +2258,6 @@ equal(void *a, void *b)
|
||||
case T_A_Const:
|
||||
retval = _equalAConst(a, b);
|
||||
break;
|
||||
case T_Ident:
|
||||
retval = _equalIdent(a, b);
|
||||
break;
|
||||
case T_FuncCall:
|
||||
retval = _equalFuncCall(a, b);
|
||||
break;
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.167 2002/08/10 20:44:48 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.168 2002/08/19 15:08:46 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||
@@ -1257,24 +1257,6 @@ _outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_outStream(StringInfo str, Stream *node)
|
||||
{
|
||||
appendStringInfo(str,
|
||||
" STREAM :pathptr @ %p :cinfo @ %p :clausetype %p :upstream @ %p ",
|
||||
node->pathptr,
|
||||
node->cinfo,
|
||||
node->clausetype,
|
||||
node->upstream);
|
||||
|
||||
appendStringInfo(str,
|
||||
" :downstream @ %p :groupup %d :groupcost %f :groupsel %f ",
|
||||
node->downstream,
|
||||
node->groupup,
|
||||
node->groupcost,
|
||||
node->groupsel);
|
||||
}
|
||||
|
||||
static void
|
||||
_outAExpr(StringInfo str, A_Expr *node)
|
||||
{
|
||||
@@ -1371,13 +1353,6 @@ _outParamRef(StringInfo str, ParamRef *node)
|
||||
_outNode(str, node->indirection);
|
||||
}
|
||||
|
||||
static void
|
||||
_outIdent(StringInfo str, Ident *node)
|
||||
{
|
||||
appendStringInfo(str, " IDENT ");
|
||||
_outToken(str, node->name);
|
||||
}
|
||||
|
||||
static void
|
||||
_outAConst(StringInfo str, A_Const *node)
|
||||
{
|
||||
@@ -1736,9 +1711,6 @@ _outNode(StringInfo str, void *obj)
|
||||
case T_JoinInfo:
|
||||
_outJoinInfo(str, obj);
|
||||
break;
|
||||
case T_Stream:
|
||||
_outStream(str, obj);
|
||||
break;
|
||||
case T_A_Expr:
|
||||
_outAExpr(str, obj);
|
||||
break;
|
||||
@@ -1751,9 +1723,6 @@ _outNode(StringInfo str, void *obj)
|
||||
case T_ParamRef:
|
||||
_outParamRef(str, obj);
|
||||
break;
|
||||
case T_Ident:
|
||||
_outIdent(str, obj);
|
||||
break;
|
||||
case T_A_Const:
|
||||
_outAConst(str, obj);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user