Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes')
-rw-r--r--src/backend/nodes/bitmapset.c174
-rw-r--r--src/backend/nodes/copyfuncs.c64
-rw-r--r--src/backend/nodes/equalfuncs.c109
-rw-r--r--src/backend/nodes/list.c19
-rw-r--r--src/backend/nodes/nodes.c4
-rw-r--r--src/backend/nodes/outfuncs.c48
-rw-r--r--src/backend/nodes/readfuncs.c59
7 files changed, 231 insertions, 246 deletions
diff --git a/src/backend/nodes/bitmapset.c b/src/backend/nodes/bitmapset.c
index c4576cf3b3d..e444f449e19 100644
--- a/src/backend/nodes/bitmapset.c
+++ b/src/backend/nodes/bitmapset.c
@@ -14,7 +14,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/bitmapset.c,v 1.3 2003/07/22 23:30:37 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/bitmapset.c,v 1.4 2003/08/04 00:43:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -38,7 +38,7 @@
* where x's are unspecified bits. The two's complement negative is formed
* by inverting all the bits and adding one. Inversion gives
* yyyyyy01111
- * where each y is the inverse of the corresponding x. Incrementing gives
+ * where each y is the inverse of the corresponding x. Incrementing gives
* yyyyyy10000
* and then ANDing with the original value gives
* 00000010000
@@ -65,41 +65,41 @@
*/
static const uint8 rightmost_one_pos[256] = {
- 0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0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mapset *
-bms_copy(const Bitmapset *a)
+bms_copy(const Bitmapset * a)
{
Bitmapset *result;
size_t size;
@@ -127,7 +127,7 @@ bms_copy(const Bitmapset *a)
* be reported as equal to a palloc'd value containing no members.
*/
bool
-bms_equal(const Bitmapset *a, const Bitmapset *b)
+bms_equal(const Bitmapset * a, const Bitmapset * b)
{
const Bitmapset *shorter;
const Bitmapset *longer;
@@ -143,9 +143,7 @@ bms_equal(const Bitmapset *a, const Bitmapset *b)
return bms_is_empty(b);
}
else if (b == NULL)
- {
return bms_is_empty(a);
- }
/* Identify shorter and longer input */
if (a->nwords <= b->nwords)
{
@@ -199,7 +197,7 @@ bms_make_singleton(int x)
* Same as pfree except for allowing NULL input
*/
void
-bms_free(Bitmapset *a)
+bms_free(Bitmapset * a)
{
if (a)
pfree(a);
@@ -216,7 +214,7 @@ bms_free(Bitmapset *a)
* bms_union - set union
*/
Bitmapset *
-bms_union(const Bitmapset *a, const Bitmapset *b)
+bms_union(const Bitmapset * a, const Bitmapset * b)
{
Bitmapset *result;
const Bitmapset *other;
@@ -242,9 +240,7 @@ bms_union(const Bitmapset *a, const Bitmapset *b)
/* And union the shorter input into the result */
otherlen = other->nwords;
for (i = 0; i < otherlen; i++)
- {
result->words[i] |= other->words[i];
- }
return result;
}
@@ -252,7 +248,7 @@ bms_union(const Bitmapset *a, const Bitmapset *b)
* bms_intersect - set intersection
*/
Bitmapset *
-bms_intersect(const Bitmapset *a, const Bitmapset *b)
+bms_intersect(const Bitmapset * a, const Bitmapset * b)
{
Bitmapset *result;
const Bitmapset *other;
@@ -276,9 +272,7 @@ bms_intersect(const Bitmapset *a, const Bitmapset *b)
/* And intersect the longer input with the result */
resultlen = result->nwords;
for (i = 0; i < resultlen; i++)
- {
result->words[i] &= other->words[i];
- }
return result;
}
@@ -286,7 +280,7 @@ bms_intersect(const Bitmapset *a, const Bitmapset *b)
* bms_difference - set difference (ie, A without members of B)
*/
Bitmapset *
-bms_difference(const Bitmapset *a, const Bitmapset *b)
+bms_difference(const Bitmapset * a, const Bitmapset * b)
{
Bitmapset *result;
int shortlen;
@@ -302,9 +296,7 @@ bms_difference(const Bitmapset *a, const Bitmapset *b)
/* And remove b's bits from result */
shortlen = Min(a->nwords, b->nwords);
for (i = 0; i < shortlen; i++)
- {
- result->words[i] &= ~ b->words[i];
- }
+ result->words[i] &= ~b->words[i];
return result;
}
@@ -312,7 +304,7 @@ bms_difference(const Bitmapset *a, const Bitmapset *b)
* bms_is_subset - is A a subset of B?
*/
bool
-bms_is_subset(const Bitmapset *a, const Bitmapset *b)
+bms_is_subset(const Bitmapset * a, const Bitmapset * b)
{
int shortlen;
int longlen;
@@ -327,7 +319,7 @@ bms_is_subset(const Bitmapset *a, const Bitmapset *b)
shortlen = Min(a->nwords, b->nwords);
for (i = 0; i < shortlen; i++)
{
- if ((a->words[i] & ~ b->words[i]) != 0)
+ if ((a->words[i] & ~b->words[i]) != 0)
return false;
}
/* Check extra words */
@@ -347,7 +339,7 @@ bms_is_subset(const Bitmapset *a, const Bitmapset *b)
* bms_is_member - is X a member of A?
*/
bool
-bms_is_member(int x, const Bitmapset *a)
+bms_is_member(int x, const Bitmapset * a)
{
int wordnum,
bitnum;
@@ -370,7 +362,7 @@ bms_is_member(int x, const Bitmapset *a)
* bms_overlap - do sets overlap (ie, have a nonempty intersection)?
*/
bool
-bms_overlap(const Bitmapset *a, const Bitmapset *b)
+bms_overlap(const Bitmapset * a, const Bitmapset * b)
{
int shortlen;
int i;
@@ -392,7 +384,7 @@ bms_overlap(const Bitmapset *a, const Bitmapset *b)
* bms_nonempty_difference - do sets have a nonempty difference?
*/
bool
-bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b)
+bms_nonempty_difference(const Bitmapset * a, const Bitmapset * b)
{
int shortlen;
int i;
@@ -406,7 +398,7 @@ bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b)
shortlen = Min(a->nwords, b->nwords);
for (i = 0; i < shortlen; i++)
{
- if ((a->words[i] & ~ b->words[i]) != 0)
+ if ((a->words[i] & ~b->words[i]) != 0)
return true;
}
/* Check extra words in a */
@@ -424,11 +416,11 @@ bms_nonempty_difference(const Bitmapset *a, const Bitmapset *b)
* Raises error if |a| is not 1.
*/
int
-bms_singleton_member(const Bitmapset *a)
+bms_singleton_member(const Bitmapset * a)
{
- int result = -1;
- int nwords;
- int wordnum;
+ int result = -1;
+ int nwords;
+ int wordnum;
if (a == NULL)
elog(ERROR, "bitmapset is empty");
@@ -459,11 +451,11 @@ bms_singleton_member(const Bitmapset *a)
* bms_num_members - count members of set
*/
int
-bms_num_members(const Bitmapset *a)
+bms_num_members(const Bitmapset * a)
{
- int result = 0;
- int nwords;
- int wordnum;
+ int result = 0;
+ int nwords;
+ int wordnum;
if (a == NULL)
return 0;
@@ -488,11 +480,11 @@ bms_num_members(const Bitmapset *a)
* This is faster than making an exact count with bms_num_members().
*/
BMS_Membership
-bms_membership(const Bitmapset *a)
+bms_membership(const Bitmapset * a)
{
BMS_Membership result = BMS_EMPTY_SET;
- int nwords;
- int wordnum;
+ int nwords;
+ int wordnum;
if (a == NULL)
return BMS_EMPTY_SET;
@@ -517,10 +509,10 @@ bms_membership(const Bitmapset *a)
* This is even faster than bms_membership().
*/
bool
-bms_is_empty(const Bitmapset *a)
+bms_is_empty(const Bitmapset * a)
{
- int nwords;
- int wordnum;
+ int nwords;
+ int wordnum;
if (a == NULL)
return true;
@@ -552,7 +544,7 @@ bms_is_empty(const Bitmapset *a)
* Input set is modified or recycled!
*/
Bitmapset *
-bms_add_member(Bitmapset *a, int x)
+bms_add_member(Bitmapset * a, int x)
{
int wordnum,
bitnum;
@@ -573,9 +565,7 @@ bms_add_member(Bitmapset *a, int x)
result = bms_make_singleton(x);
nwords = a->nwords;
for (i = 0; i < nwords; i++)
- {
result->words[i] |= a->words[i];
- }
pfree(a);
return result;
}
@@ -592,7 +582,7 @@ bms_add_member(Bitmapset *a, int x)
* Input set is modified in-place!
*/
Bitmapset *
-bms_del_member(Bitmapset *a, int x)
+bms_del_member(Bitmapset * a, int x)
{
int wordnum,
bitnum;
@@ -604,9 +594,7 @@ bms_del_member(Bitmapset *a, int x)
wordnum = WORDNUM(x);
bitnum = BITNUM(x);
if (wordnum < a->nwords)
- {
- a->words[wordnum] &= ~ ((bitmapword) 1 << bitnum);
- }
+ a->words[wordnum] &= ~((bitmapword) 1 << bitnum);
return a;
}
@@ -614,7 +602,7 @@ bms_del_member(Bitmapset *a, int x)
* bms_add_members - like bms_union, but left input is recycled
*/
Bitmapset *
-bms_add_members(Bitmapset *a, const Bitmapset *b)
+bms_add_members(Bitmapset * a, const Bitmapset * b)
{
Bitmapset *result;
const Bitmapset *other;
@@ -640,9 +628,7 @@ bms_add_members(Bitmapset *a, const Bitmapset *b)
/* And union the shorter input into the result */
otherlen = other->nwords;
for (i = 0; i < otherlen; i++)
- {
result->words[i] |= other->words[i];
- }
if (result != a)
pfree(a);
return result;
@@ -652,7 +638,7 @@ bms_add_members(Bitmapset *a, const Bitmapset *b)
* bms_int_members - like bms_intersect, but left input is recycled
*/
Bitmapset *
-bms_int_members(Bitmapset *a, const Bitmapset *b)
+bms_int_members(Bitmapset * a, const Bitmapset * b)
{
int shortlen;
int i;
@@ -668,13 +654,9 @@ bms_int_members(Bitmapset *a, const Bitmapset *b)
/* Intersect b into a; we need never copy */
shortlen = Min(a->nwords, b->nwords);
for (i = 0; i < shortlen; i++)
- {
a->words[i] &= b->words[i];
- }
for (; i < a->nwords; i++)
- {
a->words[i] = 0;
- }
return a;
}
@@ -682,7 +664,7 @@ bms_int_members(Bitmapset *a, const Bitmapset *b)
* bms_del_members - like bms_difference, but left input is recycled
*/
Bitmapset *
-bms_del_members(Bitmapset *a, const Bitmapset *b)
+bms_del_members(Bitmapset * a, const Bitmapset * b)
{
int shortlen;
int i;
@@ -695,9 +677,7 @@ bms_del_members(Bitmapset *a, const Bitmapset *b)
/* Remove b's bits from a; we need never copy */
shortlen = Min(a->nwords, b->nwords);
for (i = 0; i < shortlen; i++)
- {
- a->words[i] &= ~ b->words[i];
- }
+ a->words[i] &= ~b->words[i];
return a;
}
@@ -705,7 +685,7 @@ bms_del_members(Bitmapset *a, const Bitmapset *b)
* bms_join - like bms_union, but *both* inputs are recycled
*/
Bitmapset *
-bms_join(Bitmapset *a, Bitmapset *b)
+bms_join(Bitmapset * a, Bitmapset * b)
{
Bitmapset *result;
Bitmapset *other;
@@ -731,9 +711,7 @@ bms_join(Bitmapset *a, Bitmapset *b)
/* And union the shorter input into the result */
otherlen = other->nwords;
for (i = 0; i < otherlen; i++)
- {
result->words[i] |= other->words[i];
- }
if (other != result) /* pure paranoia */
pfree(other);
return result;
@@ -742,24 +720,22 @@ bms_join(Bitmapset *a, Bitmapset *b)
/*----------
* bms_first_member - find and remove first member of a set
*
- * Returns -1 if set is empty. NB: set is destructively modified!
+ * Returns -1 if set is empty. NB: set is destructively modified!
*
* This is intended as support for iterating through the members of a set.
* The typical pattern is
*
* tmpset = bms_copy(inputset);
* while ((x = bms_first_member(tmpset)) >= 0)
- * {
* process member x;
- * }
* bms_free(tmpset);
*----------
*/
int
-bms_first_member(Bitmapset *a)
+bms_first_member(Bitmapset * a)
{
- int nwords;
- int wordnum;
+ int nwords;
+ int wordnum;
if (a == NULL)
return -1;
@@ -770,10 +746,10 @@ bms_first_member(Bitmapset *a)
if (w != 0)
{
- int result;
+ int result;
w = RIGHTMOST_ONE(w);
- a->words[wordnum] &= ~ w;
+ a->words[wordnum] &= ~w;
result = wordnum * BITS_PER_BITMAPWORD;
while ((w & 255) == 0)
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 6945e98d5d7..03349efdc74 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -4,7 +4,7 @@
* Copy functions for Postgres tree nodes.
*
* NOTE: we currently support copying all node types found in parse and
- * plan trees. We do not support copying executor state trees; there
+ * plan trees. We do not support copying executor state trees; there
* is no need for that, and no point in maintaining all the code that
* would be needed. We also do not support copying Path trees, mainly
* because the circular linkages between RelOptInfo and Path nodes can't
@@ -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.260 2003/07/22 23:30:37 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.261 2003/08/04 00:43:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,7 +30,7 @@
/*
* Macros to simplify copying of different kinds of fields. Use these
- * wherever possible to reduce the chance for silly typos. Note that these
+ * wherever possible to reduce the chance for silly typos. Note that these
* hard-wire the convention that the local variables in a Copy routine are
* named 'newnode' and 'from'.
*/
@@ -639,7 +639,7 @@ _copyRangeVar(RangeVar *from)
/*
* We don't need a _copyExpr because Expr is an abstract supertype which
- * should never actually get instantiated. Also, since it has no common
+ * should never actually get instantiated. Also, since it has no common
* fields except NodeTag, there's no need for a helper routine to factor
* out copying the common fields...
*/
@@ -755,9 +755,9 @@ _copyArrayRef(ArrayRef *from)
* _copyFuncExpr
*/
static FuncExpr *
-_copyFuncExpr(FuncExpr *from)
+_copyFuncExpr(FuncExpr * from)
{
- FuncExpr *newnode = makeNode(FuncExpr);
+ FuncExpr *newnode = makeNode(FuncExpr);
COPY_SCALAR_FIELD(funcid);
COPY_SCALAR_FIELD(funcresulttype);
@@ -772,7 +772,7 @@ _copyFuncExpr(FuncExpr *from)
* _copyOpExpr
*/
static OpExpr *
-_copyOpExpr(OpExpr *from)
+_copyOpExpr(OpExpr * from)
{
OpExpr *newnode = makeNode(OpExpr);
@@ -789,9 +789,9 @@ _copyOpExpr(OpExpr *from)
* _copyDistinctExpr (same as OpExpr)
*/
static DistinctExpr *
-_copyDistinctExpr(DistinctExpr *from)
+_copyDistinctExpr(DistinctExpr * from)
{
- DistinctExpr *newnode = makeNode(DistinctExpr);
+ DistinctExpr *newnode = makeNode(DistinctExpr);
COPY_SCALAR_FIELD(opno);
COPY_SCALAR_FIELD(opfuncid);
@@ -806,9 +806,9 @@ _copyDistinctExpr(DistinctExpr *from)
* _copyScalarArrayOpExpr
*/
static ScalarArrayOpExpr *
-_copyScalarArrayOpExpr(ScalarArrayOpExpr *from)
+_copyScalarArrayOpExpr(ScalarArrayOpExpr * from)
{
- ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
+ ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr);
COPY_SCALAR_FIELD(opno);
COPY_SCALAR_FIELD(opfuncid);
@@ -822,9 +822,9 @@ _copyScalarArrayOpExpr(ScalarArrayOpExpr *from)
* _copyBoolExpr
*/
static BoolExpr *
-_copyBoolExpr(BoolExpr *from)
+_copyBoolExpr(BoolExpr * from)
{
- BoolExpr *newnode = makeNode(BoolExpr);
+ BoolExpr *newnode = makeNode(BoolExpr);
COPY_SCALAR_FIELD(boolop);
COPY_NODE_FIELD(args);
@@ -940,9 +940,9 @@ _copyCaseWhen(CaseWhen *from)
* _copyArrayExpr
*/
static ArrayExpr *
-_copyArrayExpr(ArrayExpr *from)
+_copyArrayExpr(ArrayExpr * from)
{
- ArrayExpr *newnode = makeNode(ArrayExpr);
+ ArrayExpr *newnode = makeNode(ArrayExpr);
COPY_SCALAR_FIELD(array_typeid);
COPY_SCALAR_FIELD(element_typeid);
@@ -956,7 +956,7 @@ _copyArrayExpr(ArrayExpr *from)
* _copyCoalesceExpr
*/
static CoalesceExpr *
-_copyCoalesceExpr(CoalesceExpr *from)
+_copyCoalesceExpr(CoalesceExpr * from)
{
CoalesceExpr *newnode = makeNode(CoalesceExpr);
@@ -970,9 +970,9 @@ _copyCoalesceExpr(CoalesceExpr *from)
* _copyNullIfExpr (same as OpExpr)
*/
static NullIfExpr *
-_copyNullIfExpr(NullIfExpr *from)
+_copyNullIfExpr(NullIfExpr * from)
{
- NullIfExpr *newnode = makeNode(NullIfExpr);
+ NullIfExpr *newnode = makeNode(NullIfExpr);
COPY_SCALAR_FIELD(opno);
COPY_SCALAR_FIELD(opfuncid);
@@ -1015,7 +1015,7 @@ _copyBooleanTest(BooleanTest *from)
* _copyCoerceToDomain
*/
static CoerceToDomain *
-_copyCoerceToDomain(CoerceToDomain *from)
+_copyCoerceToDomain(CoerceToDomain * from)
{
CoerceToDomain *newnode = makeNode(CoerceToDomain);
@@ -1031,7 +1031,7 @@ _copyCoerceToDomain(CoerceToDomain *from)
* _copyCoerceToDomainValue
*/
static CoerceToDomainValue *
-_copyCoerceToDomainValue(CoerceToDomainValue *from)
+_copyCoerceToDomainValue(CoerceToDomainValue * from)
{
CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue);
@@ -1045,7 +1045,7 @@ _copyCoerceToDomainValue(CoerceToDomainValue *from)
* _copySetToDefault
*/
static SetToDefault *
-_copySetToDefault(SetToDefault *from)
+_copySetToDefault(SetToDefault * from)
{
SetToDefault *newnode = makeNode(SetToDefault);
@@ -1148,7 +1148,7 @@ _copyRestrictInfo(RestrictInfo *from)
COPY_NODE_FIELD(clause);
COPY_SCALAR_FIELD(ispusheddown);
- COPY_NODE_FIELD(subclauseindices); /* XXX probably bad */
+ COPY_NODE_FIELD(subclauseindices); /* XXX probably bad */
COPY_SCALAR_FIELD(eval_cost);
COPY_SCALAR_FIELD(this_selec);
COPY_BITMAPSET_FIELD(left_relids);
@@ -1191,7 +1191,7 @@ _copyJoinInfo(JoinInfo *from)
* _copyInClauseInfo
*/
static InClauseInfo *
-_copyInClauseInfo(InClauseInfo *from)
+_copyInClauseInfo(InClauseInfo * from)
{
InClauseInfo *newnode = makeNode(InClauseInfo);
@@ -1532,9 +1532,9 @@ _copyQuery(Query *from)
/*
* We do not copy the other planner internal fields: base_rel_list,
- * other_rel_list, join_rel_list, equi_key_list, query_pathkeys.
- * That would get us into copying RelOptInfo/Path trees, which we don't
- * want to do. It is necessary to copy in_info_list and hasJoinRTEs
+ * other_rel_list, join_rel_list, equi_key_list, query_pathkeys. That
+ * would get us into copying RelOptInfo/Path trees, which we don't
+ * want to do. It is necessary to copy in_info_list and hasJoinRTEs
* for the benefit of inheritance_planner(), which may try to copy a
* Query in which these are already set.
*/
@@ -1633,7 +1633,7 @@ _copyAlterTableStmt(AlterTableStmt *from)
}
static AlterDomainStmt *
-_copyAlterDomainStmt(AlterDomainStmt *from)
+_copyAlterDomainStmt(AlterDomainStmt * from)
{
AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
@@ -1644,7 +1644,7 @@ _copyAlterDomainStmt(AlterDomainStmt *from)
COPY_SCALAR_FIELD(behavior);
return newnode;
-}
+}
static GrantStmt *
_copyGrantStmt(GrantStmt *from)
@@ -1685,7 +1685,7 @@ _copyFuncWithArgs(FuncWithArgs *from)
}
static DeclareCursorStmt *
-_copyDeclareCursorStmt(DeclareCursorStmt *from)
+_copyDeclareCursorStmt(DeclareCursorStmt * from)
{
DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);
@@ -1747,7 +1747,7 @@ _copyCreateStmt(CreateStmt *from)
}
static InhRelation *
-_copyInhRelation(InhRelation *from)
+_copyInhRelation(InhRelation * from)
{
InhRelation *newnode = makeNode(InhRelation);
@@ -2118,7 +2118,7 @@ _copyCreateSeqStmt(CreateSeqStmt *from)
}
static AlterSeqStmt *
-_copyAlterSeqStmt(AlterSeqStmt *from)
+_copyAlterSeqStmt(AlterSeqStmt * from)
{
AlterSeqStmt *newnode = makeNode(AlterSeqStmt);
@@ -2171,7 +2171,7 @@ _copyCreateTrigStmt(CreateTrigStmt *from)
COPY_NODE_FIELD(args);
COPY_SCALAR_FIELD(before);
COPY_SCALAR_FIELD(row);
- strcpy(newnode->actions, from->actions); /* in-line string field */
+ strcpy(newnode->actions, from->actions); /* in-line string field */
COPY_SCALAR_FIELD(isconstraint);
COPY_SCALAR_FIELD(deferrable);
COPY_SCALAR_FIELD(initdeferred);
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 513c17b048c..924793d07ec 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -11,14 +11,14 @@
* be handled easily in a simple depth-first traversal.
*
* Currently, in fact, equal() doesn't know how to compare Plan trees
- * either. This might need to be fixed someday.
+ * either. This might need to be fixed someday.
*
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.204 2003/07/28 00:09:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.205 2003/08/04 00:43:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -32,8 +32,8 @@
/*
- * Macros to simplify comparison of different kinds of fields. Use these
- * wherever possible to reduce the chance for silly typos. Note that these
+ * Macros to simplify comparison of different kinds of fields. Use these
+ * wherever possible to reduce the chance for silly typos. Note that these
* hard-wire the convention that the local variables in an Equal routine are
* named 'a' and 'b'.
*/
@@ -135,7 +135,7 @@ _equalRangeVar(RangeVar *a, RangeVar *b)
/*
* We don't need an _equalExpr because Expr is an abstract supertype which
- * should never actually get instantiated. Also, since it has no common
+ * should never actually get instantiated. Also, since it has no common
* fields except NodeTag, there's no need for a helper routine to factor
* out comparing the common fields...
*/
@@ -224,11 +224,12 @@ _equalArrayRef(ArrayRef *a, ArrayRef *b)
}
static bool
-_equalFuncExpr(FuncExpr *a, FuncExpr *b)
+_equalFuncExpr(FuncExpr * a, FuncExpr * b)
{
COMPARE_SCALAR_FIELD(funcid);
COMPARE_SCALAR_FIELD(funcresulttype);
COMPARE_SCALAR_FIELD(funcretset);
+
/*
* Special-case COERCE_DONTCARE, so that pathkeys can build coercion
* nodes that are equal() to both explicit and implicit coercions.
@@ -244,14 +245,15 @@ _equalFuncExpr(FuncExpr *a, FuncExpr *b)
}
static bool
-_equalOpExpr(OpExpr *a, OpExpr *b)
+_equalOpExpr(OpExpr * a, OpExpr * b)
{
COMPARE_SCALAR_FIELD(opno);
+
/*
- * Special-case opfuncid: it is allowable for it to differ if one
- * node contains zero and the other doesn't. This just means that the
- * one node isn't as far along in the parse/plan pipeline and hasn't
- * had the opfuncid cache filled yet.
+ * Special-case opfuncid: it is allowable for it to differ if one node
+ * contains zero and the other doesn't. This just means that the one
+ * node isn't as far along in the parse/plan pipeline and hasn't had
+ * the opfuncid cache filled yet.
*/
if (a->opfuncid != b->opfuncid &&
a->opfuncid != 0 &&
@@ -266,14 +268,15 @@ _equalOpExpr(OpExpr *a, OpExpr *b)
}
static bool
-_equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
+_equalDistinctExpr(DistinctExpr * a, DistinctExpr * b)
{
COMPARE_SCALAR_FIELD(opno);
+
/*
- * Special-case opfuncid: it is allowable for it to differ if one
- * node contains zero and the other doesn't. This just means that the
- * one node isn't as far along in the parse/plan pipeline and hasn't
- * had the opfuncid cache filled yet.
+ * Special-case opfuncid: it is allowable for it to differ if one node
+ * contains zero and the other doesn't. This just means that the one
+ * node isn't as far along in the parse/plan pipeline and hasn't had
+ * the opfuncid cache filled yet.
*/
if (a->opfuncid != b->opfuncid &&
a->opfuncid != 0 &&
@@ -288,14 +291,15 @@ _equalDistinctExpr(DistinctExpr *a, DistinctExpr *b)
}
static bool
-_equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
+_equalScalarArrayOpExpr(ScalarArrayOpExpr * a, ScalarArrayOpExpr * b)
{
COMPARE_SCALAR_FIELD(opno);
+
/*
- * Special-case opfuncid: it is allowable for it to differ if one
- * node contains zero and the other doesn't. This just means that the
- * one node isn't as far along in the parse/plan pipeline and hasn't
- * had the opfuncid cache filled yet.
+ * Special-case opfuncid: it is allowable for it to differ if one node
+ * contains zero and the other doesn't. This just means that the one
+ * node isn't as far along in the parse/plan pipeline and hasn't had
+ * the opfuncid cache filled yet.
*/
if (a->opfuncid != b->opfuncid &&
a->opfuncid != 0 &&
@@ -309,7 +313,7 @@ _equalScalarArrayOpExpr(ScalarArrayOpExpr *a, ScalarArrayOpExpr *b)
}
static bool
-_equalBoolExpr(BoolExpr *a, BoolExpr *b)
+_equalBoolExpr(BoolExpr * a, BoolExpr * b)
{
COMPARE_SCALAR_FIELD(boolop);
COMPARE_NODE_FIELD(args);
@@ -366,6 +370,7 @@ _equalRelabelType(RelabelType *a, RelabelType *b)
COMPARE_NODE_FIELD(arg);
COMPARE_SCALAR_FIELD(resulttype);
COMPARE_SCALAR_FIELD(resulttypmod);
+
/*
* Special-case COERCE_DONTCARE, so that pathkeys can build coercion
* nodes that are equal() to both explicit and implicit coercions.
@@ -399,7 +404,7 @@ _equalCaseWhen(CaseWhen *a, CaseWhen *b)
}
static bool
-_equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
+_equalArrayExpr(ArrayExpr * a, ArrayExpr * b)
{
COMPARE_SCALAR_FIELD(array_typeid);
COMPARE_SCALAR_FIELD(element_typeid);
@@ -410,7 +415,7 @@ _equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
}
static bool
-_equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
+_equalCoalesceExpr(CoalesceExpr * a, CoalesceExpr * b)
{
COMPARE_SCALAR_FIELD(coalescetype);
COMPARE_NODE_FIELD(args);
@@ -419,14 +424,15 @@ _equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
}
static bool
-_equalNullIfExpr(NullIfExpr *a, NullIfExpr *b)
+_equalNullIfExpr(NullIfExpr * a, NullIfExpr * b)
{
COMPARE_SCALAR_FIELD(opno);
+
/*
- * Special-case opfuncid: it is allowable for it to differ if one
- * node contains zero and the other doesn't. This just means that the
- * one node isn't as far along in the parse/plan pipeline and hasn't
- * had the opfuncid cache filled yet.
+ * Special-case opfuncid: it is allowable for it to differ if one node
+ * contains zero and the other doesn't. This just means that the one
+ * node isn't as far along in the parse/plan pipeline and hasn't had
+ * the opfuncid cache filled yet.
*/
if (a->opfuncid != b->opfuncid &&
a->opfuncid != 0 &&
@@ -459,11 +465,12 @@ _equalBooleanTest(BooleanTest *a, BooleanTest *b)
}
static bool
-_equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
+_equalCoerceToDomain(CoerceToDomain * a, CoerceToDomain * b)
{
COMPARE_NODE_FIELD(arg);
COMPARE_SCALAR_FIELD(resulttype);
COMPARE_SCALAR_FIELD(resulttypmod);
+
/*
* Special-case COERCE_DONTCARE, so that pathkeys can build coercion
* nodes that are equal() to both explicit and implicit coercions.
@@ -477,7 +484,7 @@ _equalCoerceToDomain(CoerceToDomain *a, CoerceToDomain *b)
}
static bool
-_equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
+_equalCoerceToDomainValue(CoerceToDomainValue * a, CoerceToDomainValue * b)
{
COMPARE_SCALAR_FIELD(typeId);
COMPARE_SCALAR_FIELD(typeMod);
@@ -486,7 +493,7 @@ _equalCoerceToDomainValue(CoerceToDomainValue *a, CoerceToDomainValue *b)
}
static bool
-_equalSetToDefault(SetToDefault *a, SetToDefault *b)
+_equalSetToDefault(SetToDefault * a, SetToDefault * b)
{
COMPARE_SCALAR_FIELD(typeId);
COMPARE_SCALAR_FIELD(typeMod);
@@ -554,11 +561,13 @@ _equalRestrictInfo(RestrictInfo *a, RestrictInfo *b)
{
COMPARE_NODE_FIELD(clause);
COMPARE_SCALAR_FIELD(ispusheddown);
+
/*
- * We ignore subclauseindices, eval_cost, this_selec, left/right_relids,
- * left/right_pathkey, and left/right_bucketsize, since they may not be
- * set yet, and should be derivable from the clause anyway. Probably it's
- * not really necessary to compare any of these remaining fields ...
+ * We ignore subclauseindices, eval_cost, this_selec,
+ * left/right_relids, left/right_pathkey, and left/right_bucketsize,
+ * since they may not be set yet, and should be derivable from the
+ * clause anyway. Probably it's not really necessary to compare any
+ * of these remaining fields ...
*/
COMPARE_SCALAR_FIELD(mergejoinoperator);
COMPARE_SCALAR_FIELD(left_sortop);
@@ -578,7 +587,7 @@ _equalJoinInfo(JoinInfo *a, JoinInfo *b)
}
static bool
-_equalInClauseInfo(InClauseInfo *a, InClauseInfo *b)
+_equalInClauseInfo(InClauseInfo * a, InClauseInfo * b)
{
COMPARE_BITMAPSET_FIELD(lefthand);
COMPARE_BITMAPSET_FIELD(righthand);
@@ -620,9 +629,9 @@ _equalQuery(Query *a, Query *b)
/*
* We do not check the other planner internal fields: base_rel_list,
- * other_rel_list, join_rel_list, equi_key_list, query_pathkeys.
- * They might not be set yet, and in any case they should be derivable
- * from the other fields.
+ * other_rel_list, join_rel_list, equi_key_list, query_pathkeys. They
+ * might not be set yet, and in any case they should be derivable from
+ * the other fields.
*/
return true;
}
@@ -706,7 +715,7 @@ _equalAlterTableStmt(AlterTableStmt *a, AlterTableStmt *b)
}
static bool
-_equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
+_equalAlterDomainStmt(AlterDomainStmt * a, AlterDomainStmt * b)
{
COMPARE_SCALAR_FIELD(subtype);
COMPARE_NODE_FIELD(typename);
@@ -750,7 +759,7 @@ _equalFuncWithArgs(FuncWithArgs *a, FuncWithArgs *b)
}
static bool
-_equalDeclareCursorStmt(DeclareCursorStmt *a, DeclareCursorStmt *b)
+_equalDeclareCursorStmt(DeclareCursorStmt * a, DeclareCursorStmt * b)
{
COMPARE_STRING_FIELD(portalname);
COMPARE_SCALAR_FIELD(options);
@@ -802,7 +811,7 @@ _equalCreateStmt(CreateStmt *a, CreateStmt *b)
}
static bool
-_equalInhRelation(InhRelation *a, InhRelation *b)
+_equalInhRelation(InhRelation * a, InhRelation * b)
{
COMPARE_NODE_FIELD(relation);
COMPARE_SCALAR_FIELD(including_defaults);
@@ -1113,7 +1122,7 @@ _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
}
static bool
-_equalAlterSeqStmt(AlterSeqStmt *a, AlterSeqStmt *b)
+_equalAlterSeqStmt(AlterSeqStmt * a, AlterSeqStmt * b)
{
COMPARE_NODE_FIELD(sequence);
COMPARE_NODE_FIELD(options);
@@ -1156,7 +1165,7 @@ _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
COMPARE_NODE_FIELD(args);
COMPARE_SCALAR_FIELD(before);
COMPARE_SCALAR_FIELD(row);
- if (strcmp(a->actions, b->actions) != 0) /* in-line string field */
+ if (strcmp(a->actions, b->actions) != 0) /* in-line string field */
return false;
COMPARE_SCALAR_FIELD(isconstraint);
COMPARE_SCALAR_FIELD(deferrable);
@@ -1400,7 +1409,7 @@ _equalParamRef(ParamRef *a, ParamRef *b)
static bool
_equalAConst(A_Const *a, A_Const *b)
{
- if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
+ if (!equal(&a->val, &b->val)) /* hack for in-line Value field */
return false;
COMPARE_NODE_FIELD(typename);
@@ -1649,9 +1658,9 @@ equal(void *a, void *b)
switch (nodeTag(a))
{
- /*
- * PRIMITIVE NODES
- */
+ /*
+ * PRIMITIVE NODES
+ */
case T_Resdom:
retval = _equalResdom(a, b);
break;
@@ -1841,7 +1850,7 @@ equal(void *a, void *b)
retval = _equalCreateStmt(a, b);
break;
case T_InhRelation:
- retval = _equalInhRelation(a,b);
+ retval = _equalInhRelation(a, b);
break;
case T_DefineStmt:
retval = _equalDefineStmt(a, b);
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
index b0f6821b8c4..354134caeaf 100644
--- a/src/backend/nodes/list.c
+++ b/src/backend/nodes/list.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.51 2003/07/22 23:30:37 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.52 2003/08/04 00:43:19 momjian Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -202,7 +202,7 @@ nconc(List *l1, List *l2)
* since we avoid having to chase down the list again each time.
*/
void
-FastAppend(FastList *fl, void *datum)
+FastAppend(FastList * fl, void *datum)
{
List *cell = makeList1(datum);
@@ -223,7 +223,7 @@ FastAppend(FastList *fl, void *datum)
* FastAppendi - same for integers
*/
void
-FastAppendi(FastList *fl, int datum)
+FastAppendi(FastList * fl, int datum)
{
List *cell = makeListi1(datum);
@@ -244,7 +244,7 @@ FastAppendi(FastList *fl, int datum)
* FastAppendo - same for Oids
*/
void
-FastAppendo(FastList *fl, Oid datum)
+FastAppendo(FastList * fl, Oid datum)
{
List *cell = makeListo1(datum);
@@ -267,14 +267,12 @@ FastAppendo(FastList *fl, Oid datum)
* Note that the cells of the second argument are absorbed into the FastList.
*/
void
-FastConc(FastList *fl, List *cells)
+FastConc(FastList * fl, List *cells)
{
if (cells == NIL)
return; /* nothing to do */
if (fl->tail)
- {
lnext(fl->tail) = cells;
- }
else
{
/* First cell of list */
@@ -292,14 +290,12 @@ FastConc(FastList *fl, List *cells)
* Note that the cells of the second argument are absorbed into the first.
*/
void
-FastConcFast(FastList *fl, FastList *fl2)
+FastConcFast(FastList * fl, FastList * fl2)
{
if (fl2->head == NIL)
return; /* nothing to do */
if (fl->tail)
- {
lnext(fl->tail) = fl2->head;
- }
else
{
/* First cell of list */
@@ -319,9 +315,7 @@ nth(int n, List *l)
{
/* XXX assume list is long enough */
while (n-- > 0)
- {
l = lnext(l);
- }
return lfirst(l);
}
@@ -781,4 +775,5 @@ lreverse(List *l)
result = lcons(lfirst(i), result);
return result;
}
+
#endif
diff --git a/src/backend/nodes/nodes.c b/src/backend/nodes/nodes.c
index f71bd020ce9..4a4e0c98f57 100644
--- a/src/backend/nodes/nodes.c
+++ b/src/backend/nodes/nodes.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.19 2002/12/16 16:22:46 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/nodes.c,v 1.20 2003/08/04 00:43:19 momjian Exp $
*
* HISTORY
* Andrew Yu Oct 20, 1994 file creation
@@ -24,4 +24,4 @@
* Support for newNode() macro
*/
-Node *newNodeMacroHolder;
+Node *newNodeMacroHolder;
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index fba59553793..9247bb00d2a 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,12 +8,12 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.214 2003/07/28 00:09:15 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.215 2003/08/04 00:43:19 momjian Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
* have an output function defined here (as well as an input function
- * in readfuncs.c). For use in debugging, we also provide output
+ * in readfuncs.c). For use in debugging, we also provide output
* functions for nodes that appear in raw parsetrees, path, and plan trees.
* These nodes however need not have input functions.
*
@@ -31,8 +31,8 @@
/*
- * Macros to simplify output of different kinds of fields. Use these
- * wherever possible to reduce the chance for silly typos. Note that these
+ * Macros to simplify output of different kinds of fields. Use these
+ * wherever possible to reduce the chance for silly typos. Note that these
* hard-wire conventions about the names of the local variables in an Out
* routine.
*/
@@ -184,7 +184,7 @@ _outOidList(StringInfo str, List *list)
* an integer List would be.
*/
static void
-_outBitmapset(StringInfo str, Bitmapset *bms)
+_outBitmapset(StringInfo str, Bitmapset * bms)
{
Bitmapset *tmpset;
int x;
@@ -192,9 +192,7 @@ _outBitmapset(StringInfo str, Bitmapset *bms)
appendStringInfoChar(str, '(');
tmpset = bms_copy(bms);
while ((x = bms_first_member(tmpset)) >= 0)
- {
appendStringInfo(str, " %d", x);
- }
bms_free(tmpset);
appendStringInfoChar(str, ')');
}
@@ -633,7 +631,7 @@ _outArrayRef(StringInfo str, ArrayRef *node)
}
static void
-_outFuncExpr(StringInfo str, FuncExpr *node)
+_outFuncExpr(StringInfo str, FuncExpr * node)
{
WRITE_NODE_TYPE("FUNCEXPR");
@@ -645,7 +643,7 @@ _outFuncExpr(StringInfo str, FuncExpr *node)
}
static void
-_outOpExpr(StringInfo str, OpExpr *node)
+_outOpExpr(StringInfo str, OpExpr * node)
{
WRITE_NODE_TYPE("OPEXPR");
@@ -657,7 +655,7 @@ _outOpExpr(StringInfo str, OpExpr *node)
}
static void
-_outDistinctExpr(StringInfo str, DistinctExpr *node)
+_outDistinctExpr(StringInfo str, DistinctExpr * node)
{
WRITE_NODE_TYPE("DISTINCTEXPR");
@@ -669,7 +667,7 @@ _outDistinctExpr(StringInfo str, DistinctExpr *node)
}
static void
-_outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr *node)
+_outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr * node)
{
WRITE_NODE_TYPE("SCALARARRAYOPEXPR");
@@ -680,7 +678,7 @@ _outScalarArrayOpExpr(StringInfo str, ScalarArrayOpExpr *node)
}
static void
-_outBoolExpr(StringInfo str, BoolExpr *node)
+_outBoolExpr(StringInfo str, BoolExpr * node)
{
char *opstr = NULL;
@@ -780,7 +778,7 @@ _outCaseWhen(StringInfo str, CaseWhen *node)
}
static void
-_outArrayExpr(StringInfo str, ArrayExpr *node)
+_outArrayExpr(StringInfo str, ArrayExpr * node)
{
WRITE_NODE_TYPE("ARRAY");
@@ -791,7 +789,7 @@ _outArrayExpr(StringInfo str, ArrayExpr *node)
}
static void
-_outCoalesceExpr(StringInfo str, CoalesceExpr *node)
+_outCoalesceExpr(StringInfo str, CoalesceExpr * node)
{
WRITE_NODE_TYPE("COALESCE");
@@ -800,7 +798,7 @@ _outCoalesceExpr(StringInfo str, CoalesceExpr *node)
}
static void
-_outNullIfExpr(StringInfo str, NullIfExpr *node)
+_outNullIfExpr(StringInfo str, NullIfExpr * node)
{
WRITE_NODE_TYPE("NULLIFEXPR");
@@ -830,7 +828,7 @@ _outBooleanTest(StringInfo str, BooleanTest *node)
}
static void
-_outCoerceToDomain(StringInfo str, CoerceToDomain *node)
+_outCoerceToDomain(StringInfo str, CoerceToDomain * node)
{
WRITE_NODE_TYPE("COERCETODOMAIN");
@@ -841,7 +839,7 @@ _outCoerceToDomain(StringInfo str, CoerceToDomain *node)
}
static void
-_outCoerceToDomainValue(StringInfo str, CoerceToDomainValue *node)
+_outCoerceToDomainValue(StringInfo str, CoerceToDomainValue * node)
{
WRITE_NODE_TYPE("COERCETODOMAINVALUE");
@@ -850,7 +848,7 @@ _outCoerceToDomainValue(StringInfo str, CoerceToDomainValue *node)
}
static void
-_outSetToDefault(StringInfo str, SetToDefault *node)
+_outSetToDefault(StringInfo str, SetToDefault * node)
{
WRITE_NODE_TYPE("SETTODEFAULT");
@@ -979,7 +977,7 @@ _outAppendPath(StringInfo str, AppendPath *node)
}
static void
-_outResultPath(StringInfo str, ResultPath *node)
+_outResultPath(StringInfo str, ResultPath * node)
{
WRITE_NODE_TYPE("RESULTPATH");
@@ -990,7 +988,7 @@ _outResultPath(StringInfo str, ResultPath *node)
}
static void
-_outMaterialPath(StringInfo str, MaterialPath *node)
+_outMaterialPath(StringInfo str, MaterialPath * node)
{
WRITE_NODE_TYPE("MATERIALPATH");
@@ -1000,7 +998,7 @@ _outMaterialPath(StringInfo str, MaterialPath *node)
}
static void
-_outUniquePath(StringInfo str, UniquePath *node)
+_outUniquePath(StringInfo str, UniquePath * node)
{
WRITE_NODE_TYPE("UNIQUEPATH");
@@ -1079,7 +1077,7 @@ _outJoinInfo(StringInfo str, JoinInfo *node)
}
static void
-_outInClauseInfo(StringInfo str, InClauseInfo *node)
+_outInClauseInfo(StringInfo str, InClauseInfo * node)
{
WRITE_NODE_TYPE("INCLAUSEINFO");
@@ -1132,7 +1130,7 @@ _outNotifyStmt(StringInfo str, NotifyStmt *node)
}
static void
-_outDeclareCursorStmt(StringInfo str, DeclareCursorStmt *node)
+_outDeclareCursorStmt(StringInfo str, DeclareCursorStmt * node)
{
WRITE_NODE_TYPE("DECLARECURSOR");
@@ -1820,9 +1818,11 @@ _outNode(StringInfo str, void *obj)
break;
default:
+
/*
* This should be an ERROR, but it's too useful to be able
- * to dump structures that _outNode only understands part of.
+ * to dump structures that _outNode only understands part
+ * of.
*/
elog(WARNING, "could not dump unrecognized node type: %d",
(int) nodeTag(obj));
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c
index abc3a1b0105..32af1d92923 100644
--- a/src/backend/nodes/readfuncs.c
+++ b/src/backend/nodes/readfuncs.c
@@ -8,11 +8,11 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.159 2003/07/22 23:30:38 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.160 2003/08/04 00:43:19 momjian Exp $
*
* NOTES
* Path and Plan nodes do not have any readfuncs support, because we
- * never have occasion to read them in. (There was once code here that
+ * never have occasion to read them in. (There was once code here that
* claimed to read them, but it was broken as well as unused.) We
* never read executor state trees, either.
*
@@ -28,7 +28,7 @@
/*
* Macros to simplify reading of different kinds of fields. Use these
- * wherever possible to reduce the chance for silly typos. Note that these
+ * wherever possible to reduce the chance for silly typos. Note that these
* hard-wire conventions about the names of the local variables in a Read
* routine.
*/
@@ -466,13 +466,14 @@ _readOpExpr(void)
READ_OID_FIELD(opno);
READ_OID_FIELD(opfuncid);
+
/*
- * The opfuncid is stored in the textual format primarily for debugging
- * and documentation reasons. We want to always read it as zero to force
- * it to be re-looked-up in the pg_operator entry. This ensures that
- * stored rules don't have hidden dependencies on operators' functions.
- * (We don't currently support an ALTER OPERATOR command, but might
- * someday.)
+ * The opfuncid is stored in the textual format primarily for
+ * debugging and documentation reasons. We want to always read it as
+ * zero to force it to be re-looked-up in the pg_operator entry. This
+ * ensures that stored rules don't have hidden dependencies on
+ * operators' functions. (We don't currently support an ALTER OPERATOR
+ * command, but might someday.)
*/
local_node->opfuncid = InvalidOid;
@@ -493,13 +494,14 @@ _readDistinctExpr(void)
READ_OID_FIELD(opno);
READ_OID_FIELD(opfuncid);
+
/*
- * The opfuncid is stored in the textual format primarily for debugging
- * and documentation reasons. We want to always read it as zero to force
- * it to be re-looked-up in the pg_operator entry. This ensures that
- * stored rules don't have hidden dependencies on operators' functions.
- * (We don't currently support an ALTER OPERATOR command, but might
- * someday.)
+ * The opfuncid is stored in the textual format primarily for
+ * debugging and documentation reasons. We want to always read it as
+ * zero to force it to be re-looked-up in the pg_operator entry. This
+ * ensures that stored rules don't have hidden dependencies on
+ * operators' functions. (We don't currently support an ALTER OPERATOR
+ * command, but might someday.)
*/
local_node->opfuncid = InvalidOid;
@@ -520,13 +522,14 @@ _readScalarArrayOpExpr(void)
READ_OID_FIELD(opno);
READ_OID_FIELD(opfuncid);
+
/*
- * The opfuncid is stored in the textual format primarily for debugging
- * and documentation reasons. We want to always read it as zero to force
- * it to be re-looked-up in the pg_operator entry. This ensures that
- * stored rules don't have hidden dependencies on operators' functions.
- * (We don't currently support an ALTER OPERATOR command, but might
- * someday.)
+ * The opfuncid is stored in the textual format primarily for
+ * debugging and documentation reasons. We want to always read it as
+ * zero to force it to be re-looked-up in the pg_operator entry. This
+ * ensures that stored rules don't have hidden dependencies on
+ * operators' functions. (We don't currently support an ALTER OPERATOR
+ * command, but might someday.)
*/
local_node->opfuncid = InvalidOid;
@@ -685,13 +688,14 @@ _readNullIfExpr(void)
READ_OID_FIELD(opno);
READ_OID_FIELD(opfuncid);
+
/*
- * The opfuncid is stored in the textual format primarily for debugging
- * and documentation reasons. We want to always read it as zero to force
- * it to be re-looked-up in the pg_operator entry. This ensures that
- * stored rules don't have hidden dependencies on operators' functions.
- * (We don't currently support an ALTER OPERATOR command, but might
- * someday.)
+ * The opfuncid is stored in the textual format primarily for
+ * debugging and documentation reasons. We want to always read it as
+ * zero to force it to be re-looked-up in the pg_operator entry. This
+ * ensures that stored rules don't have hidden dependencies on
+ * operators' functions. (We don't currently support an ALTER OPERATOR
+ * command, but might someday.)
*/
local_node->opfuncid = InvalidOid;
@@ -955,6 +959,7 @@ Node *
parseNodeString(void)
{
void *return_value;
+
READ_TEMP_LOCALS();
token = pg_strtok(&length);