Commit 4fcd0d63 authored by Bruce Momjian's avatar Bruce Momjian

FIx confusion over SORT and SORTCLAUSE in node handling.

parent 1efd2cf7
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.33 1998/02/26 04:32:12 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.34 1998/04/27 02:58:05 momjian Exp $
* *
* NOTES * NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which * Every (plan) node in POSTGRES has an associated "out" routine which
...@@ -70,22 +70,22 @@ _outIntList(StringInfo str, List *list) ...@@ -70,22 +70,22 @@ _outIntList(StringInfo str, List *list)
static void static void
_outCreateStmt(StringInfo str, CreateStmt *node) _outCreateStmt(StringInfo str, CreateStmt *node)
{ {
appendStringInfo(str, "CREATE"); appendStringInfo(str, " CREATE ");
appendStringInfo(str, " :relname "); appendStringInfo(str, " :relname ");
appendStringInfo(str, node->relname); appendStringInfo(str, node->relname);
appendStringInfo(str, " :columns"); appendStringInfo(str, " :columns ");
_outNode(str, node->tableElts); _outNode(str, node->tableElts);
appendStringInfo(str, " :inhRelnames"); appendStringInfo(str, " :inhRelnames ");
_outNode(str, node->inhRelnames); _outNode(str, node->inhRelnames);
appendStringInfo(str, " :constraints"); appendStringInfo(str, " :constraints ");
_outNode(str, node->constraints); _outNode(str, node->constraints);
} }
static void static void
_outIndexStmt(StringInfo str, IndexStmt *node) _outIndexStmt(StringInfo str, IndexStmt *node)
{ {
appendStringInfo(str, "INDEX"); appendStringInfo(str, " INDEX ");
appendStringInfo(str, " :idxname "); appendStringInfo(str, " :idxname ");
appendStringInfo(str, node->idxname); appendStringInfo(str, node->idxname);
...@@ -110,7 +110,7 @@ _outIndexStmt(StringInfo str, IndexStmt *node) ...@@ -110,7 +110,7 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
static void static void
_outColumnDef(StringInfo str, ColumnDef *node) _outColumnDef(StringInfo str, ColumnDef *node)
{ {
appendStringInfo(str, "COLUMNDEF"); appendStringInfo(str, " COLUMNDEF ");
appendStringInfo(str, " :colname "); appendStringInfo(str, " :colname ");
appendStringInfo(str, node->colname); appendStringInfo(str, node->colname);
...@@ -120,7 +120,7 @@ _outColumnDef(StringInfo str, ColumnDef *node) ...@@ -120,7 +120,7 @@ _outColumnDef(StringInfo str, ColumnDef *node)
appendStringInfo(str, (node->is_not_null ? "true" : "false")); appendStringInfo(str, (node->is_not_null ? "true" : "false"));
appendStringInfo(str, " :defval "); appendStringInfo(str, " :defval ");
appendStringInfo(str, node->defval); appendStringInfo(str, node->defval);
appendStringInfo(str, " :constraints"); appendStringInfo(str, " :constraints ");
_outNode(str, node->constraints); _outNode(str, node->constraints);
} }
...@@ -129,7 +129,7 @@ _outTypeName(StringInfo str, TypeName *node) ...@@ -129,7 +129,7 @@ _outTypeName(StringInfo str, TypeName *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "TYPENAME"); appendStringInfo(str, " TYPENAME ");
appendStringInfo(str, " :name "); appendStringInfo(str, " :name ");
appendStringInfo(str, node->name); appendStringInfo(str, node->name);
...@@ -147,7 +147,7 @@ _outTypeName(StringInfo str, TypeName *node) ...@@ -147,7 +147,7 @@ _outTypeName(StringInfo str, TypeName *node)
static void static void
_outIndexElem(StringInfo str, IndexElem *node) _outIndexElem(StringInfo str, IndexElem *node)
{ {
appendStringInfo(str, "INDEXELEM"); appendStringInfo(str, " INDEXELEM ");
appendStringInfo(str, " :name "); appendStringInfo(str, " :name ");
appendStringInfo(str, node->name); appendStringInfo(str, node->name);
...@@ -155,7 +155,7 @@ _outIndexElem(StringInfo str, IndexElem *node) ...@@ -155,7 +155,7 @@ _outIndexElem(StringInfo str, IndexElem *node)
_outNode(str, node->args); _outNode(str, node->args);
appendStringInfo(str, " :class "); appendStringInfo(str, " :class ");
appendStringInfo(str, node->class); appendStringInfo(str, node->class);
appendStringInfo(str, " :tname"); appendStringInfo(str, " :tname ");
_outNode(str, node->tname); _outNode(str, node->tname);
} }
...@@ -164,7 +164,7 @@ _outQuery(StringInfo str, Query *node) ...@@ -164,7 +164,7 @@ _outQuery(StringInfo str, Query *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "QUERY"); appendStringInfo(str, " QUERY ");
appendStringInfo(str, " :command "); appendStringInfo(str, " :command ");
sprintf(buf, " %d ", node->commandType); sprintf(buf, " %d ", node->commandType);
...@@ -241,7 +241,7 @@ _outSortClause(StringInfo str, SortClause *node) ...@@ -241,7 +241,7 @@ _outSortClause(StringInfo str, SortClause *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "SORTCLAUSE"); appendStringInfo(str, " SORTCLAUSE ");
appendStringInfo(str, " :resdom "); appendStringInfo(str, " :resdom ");
_outNode(str, node->resdom); _outNode(str, node->resdom);
...@@ -255,7 +255,7 @@ _outGroupClause(StringInfo str, GroupClause *node) ...@@ -255,7 +255,7 @@ _outGroupClause(StringInfo str, GroupClause *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "GROUPCLAUSE"); appendStringInfo(str, " GROUPCLAUSE ");
appendStringInfo(str, " :entry "); appendStringInfo(str, " :entry ");
_outNode(str, node->entry); _outNode(str, node->entry);
...@@ -304,14 +304,14 @@ _outPlanInfo(StringInfo str, Plan *node) ...@@ -304,14 +304,14 @@ _outPlanInfo(StringInfo str, Plan *node)
static void static void
_outPlan(StringInfo str, Plan *node) _outPlan(StringInfo str, Plan *node)
{ {
appendStringInfo(str, "PLAN"); appendStringInfo(str, " PLAN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
} }
static void static void
_outResult(StringInfo str, Result *node) _outResult(StringInfo str, Result *node)
{ {
appendStringInfo(str, "RESULT"); appendStringInfo(str, " RESULT ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :resconstantqual "); appendStringInfo(str, " :resconstantqual ");
...@@ -327,7 +327,7 @@ _outAppend(StringInfo str, Append *node) ...@@ -327,7 +327,7 @@ _outAppend(StringInfo str, Append *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "APPEND"); appendStringInfo(str, " APPEND ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :unionplans "); appendStringInfo(str, " :unionplans ");
...@@ -350,7 +350,7 @@ _outAppend(StringInfo str, Append *node) ...@@ -350,7 +350,7 @@ _outAppend(StringInfo str, Append *node)
static void static void
_outJoin(StringInfo str, Join *node) _outJoin(StringInfo str, Join *node)
{ {
appendStringInfo(str, "JOIN"); appendStringInfo(str, " JOIN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
} }
...@@ -361,7 +361,7 @@ _outJoin(StringInfo str, Join *node) ...@@ -361,7 +361,7 @@ _outJoin(StringInfo str, Join *node)
static void static void
_outNestLoop(StringInfo str, NestLoop *node) _outNestLoop(StringInfo str, NestLoop *node)
{ {
appendStringInfo(str, "NESTLOOP"); appendStringInfo(str, " NESTLOOP ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
} }
...@@ -373,7 +373,7 @@ _outMergeJoin(StringInfo str, MergeJoin *node) ...@@ -373,7 +373,7 @@ _outMergeJoin(StringInfo str, MergeJoin *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "MERGEJOIN"); appendStringInfo(str, " MERGEJOIN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :mergeclauses "); appendStringInfo(str, " :mergeclauses ");
...@@ -397,7 +397,7 @@ _outHashJoin(StringInfo str, HashJoin *node) ...@@ -397,7 +397,7 @@ _outHashJoin(StringInfo str, HashJoin *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "HASHJOIN"); appendStringInfo(str, " HASHJOIN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :hashclauses "); appendStringInfo(str, " :hashclauses ");
...@@ -420,7 +420,7 @@ _outSubPlan(StringInfo str, SubPlan *node) ...@@ -420,7 +420,7 @@ _outSubPlan(StringInfo str, SubPlan *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "SUBPLAN"); appendStringInfo(str, " SUBPLAN ");
appendStringInfo(str, " :plan "); appendStringInfo(str, " :plan ");
_outNode(str, node->plan); _outNode(str, node->plan);
sprintf(buf, " :planid %u ", node->plan_id); sprintf(buf, " :planid %u ", node->plan_id);
...@@ -443,7 +443,7 @@ _outScan(StringInfo str, Scan *node) ...@@ -443,7 +443,7 @@ _outScan(StringInfo str, Scan *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "SCAN"); appendStringInfo(str, " SCAN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :scanrelid %d ", node->scanrelid); sprintf(buf, " :scanrelid %d ", node->scanrelid);
...@@ -459,7 +459,7 @@ _outSeqScan(StringInfo str, SeqScan *node) ...@@ -459,7 +459,7 @@ _outSeqScan(StringInfo str, SeqScan *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "SEQSCAN"); appendStringInfo(str, " SEQSCAN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :scanrelid %d ", node->scanrelid); sprintf(buf, " :scanrelid %d ", node->scanrelid);
...@@ -476,7 +476,7 @@ _outIndexScan(StringInfo str, IndexScan *node) ...@@ -476,7 +476,7 @@ _outIndexScan(StringInfo str, IndexScan *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "INDEXSCAN"); appendStringInfo(str, " INDEXSCAN ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :scanrelid %d ", node->scan.scanrelid); sprintf(buf, " :scanrelid %d ", node->scan.scanrelid);
...@@ -498,7 +498,7 @@ _outTemp(StringInfo str, Temp *node) ...@@ -498,7 +498,7 @@ _outTemp(StringInfo str, Temp *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "TEMP"); appendStringInfo(str, " TEMP ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :tempid %u ", node->tempid); sprintf(buf, " :tempid %u ", node->tempid);
...@@ -516,7 +516,7 @@ _outSort(StringInfo str, Sort *node) ...@@ -516,7 +516,7 @@ _outSort(StringInfo str, Sort *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "SORT"); appendStringInfo(str, " SORT ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :tempid %u ", node->tempid); sprintf(buf, " :tempid %u ", node->tempid);
...@@ -530,7 +530,7 @@ static void ...@@ -530,7 +530,7 @@ static void
_outAgg(StringInfo str, Agg *node) _outAgg(StringInfo str, Agg *node)
{ {
appendStringInfo(str, "AGG"); appendStringInfo(str, " AGG ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :aggs "); appendStringInfo(str, " :aggs ");
...@@ -542,7 +542,7 @@ _outGroup(StringInfo str, Group *node) ...@@ -542,7 +542,7 @@ _outGroup(StringInfo str, Group *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "GRP"); appendStringInfo(str, " GRP ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
/* the actual Group fields */ /* the actual Group fields */
...@@ -561,7 +561,7 @@ _outUnique(StringInfo str, Unique *node) ...@@ -561,7 +561,7 @@ _outUnique(StringInfo str, Unique *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "UNIQUE"); appendStringInfo(str, " UNIQUE ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :tempid %u ", node->tempid); sprintf(buf, " :tempid %u ", node->tempid);
...@@ -580,7 +580,7 @@ _outHash(StringInfo str, Hash *node) ...@@ -580,7 +580,7 @@ _outHash(StringInfo str, Hash *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "HASH"); appendStringInfo(str, " HASH ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
appendStringInfo(str, " :hashkey "); appendStringInfo(str, " :hashkey ");
...@@ -599,7 +599,7 @@ _outTee(StringInfo str, Tee *node) ...@@ -599,7 +599,7 @@ _outTee(StringInfo str, Tee *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "TEE"); appendStringInfo(str, " TEE ");
_outPlanInfo(str, (Plan *) node); _outPlanInfo(str, (Plan *) node);
sprintf(buf, " :leftParent %X ", (int) (node->leftParent)); sprintf(buf, " :leftParent %X ", (int) (node->leftParent));
...@@ -628,7 +628,7 @@ _outResdom(StringInfo str, Resdom *node) ...@@ -628,7 +628,7 @@ _outResdom(StringInfo str, Resdom *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "RESDOM"); appendStringInfo(str, " RESDOM ");
sprintf(buf, " :resno %d ", node->resno); sprintf(buf, " :resno %d ", node->resno);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :restype %u ", node->restype); sprintf(buf, " :restype %u ", node->restype);
...@@ -652,7 +652,7 @@ _outFjoin(StringInfo str, Fjoin *node) ...@@ -652,7 +652,7 @@ _outFjoin(StringInfo str, Fjoin *node)
char buf[500]; char buf[500];
int i; int i;
appendStringInfo(str, "FJOIN"); appendStringInfo(str, " FJOIN ");
appendStringInfo(str, " :initialized "); appendStringInfo(str, " :initialized ");
appendStringInfo(str, node->fj_initialized ? "true" : "false"); appendStringInfo(str, node->fj_initialized ? "true" : "false");
sprintf(buf, " :nNodes %d ", node->fj_nNodes); sprintf(buf, " :nNodes %d ", node->fj_nNodes);
...@@ -680,7 +680,7 @@ _outExpr(StringInfo str, Expr *node) ...@@ -680,7 +680,7 @@ _outExpr(StringInfo str, Expr *node)
char buf[500]; char buf[500];
char *opstr = NULL; char *opstr = NULL;
appendStringInfo(str, "EXPR"); appendStringInfo(str, " EXPR ");
sprintf(buf, " :typeOid %u ", node->typeOid); sprintf(buf, " :typeOid %u ", node->typeOid);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -721,7 +721,7 @@ _outVar(StringInfo str, Var *node) ...@@ -721,7 +721,7 @@ _outVar(StringInfo str, Var *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "VAR"); appendStringInfo(str, " VAR ");
sprintf(buf, " :varno %d ", node->varno); sprintf(buf, " :varno %d ", node->varno);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :varattno %d ", node->varattno); sprintf(buf, " :varattno %d ", node->varattno);
...@@ -746,7 +746,7 @@ _outConst(StringInfo str, Const *node) ...@@ -746,7 +746,7 @@ _outConst(StringInfo str, Const *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "CONST"); appendStringInfo(str, " CONST ");
sprintf(buf, " :consttype %u ", node->consttype); sprintf(buf, " :consttype %u ", node->consttype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :constlen %d ", node->constlen); sprintf(buf, " :constlen %d ", node->constlen);
...@@ -774,7 +774,7 @@ _outAggreg(StringInfo str, Aggreg *node) ...@@ -774,7 +774,7 @@ _outAggreg(StringInfo str, Aggreg *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "AGGREG"); appendStringInfo(str, " AGGREG ");
appendStringInfo(str, " :aggname "); appendStringInfo(str, " :aggname ");
appendStringInfo(str, (char *) node->aggname); appendStringInfo(str, (char *) node->aggname);
sprintf(buf, " :basetype %u ", node->basetype); sprintf(buf, " :basetype %u ", node->basetype);
...@@ -797,7 +797,7 @@ _outSubLink(StringInfo str, SubLink *node) ...@@ -797,7 +797,7 @@ _outSubLink(StringInfo str, SubLink *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "SUBLINK"); appendStringInfo(str, " SUBLINK ");
sprintf(buf, " :subLinkType %d ", node->subLinkType); sprintf(buf, " :subLinkType %d ", node->subLinkType);
appendStringInfo(str, buf); appendStringInfo(str, buf);
appendStringInfo(str, " :useor "); appendStringInfo(str, " :useor ");
...@@ -819,7 +819,7 @@ _outArray(StringInfo str, Array *node) ...@@ -819,7 +819,7 @@ _outArray(StringInfo str, Array *node)
char buf[500]; char buf[500];
int i; int i;
appendStringInfo(str, "ARRAY"); appendStringInfo(str, " ARRAY ");
sprintf(buf, " :arrayelemtype %u ", node->arrayelemtype); sprintf(buf, " :arrayelemtype %u ", node->arrayelemtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :arrayelemlength %d ", node->arrayelemlength); sprintf(buf, " :arrayelemlength %d ", node->arrayelemlength);
...@@ -852,7 +852,7 @@ _outArrayRef(StringInfo str, ArrayRef *node) ...@@ -852,7 +852,7 @@ _outArrayRef(StringInfo str, ArrayRef *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "ARRAYREF"); appendStringInfo(str, " ARRAYREF ");
sprintf(buf, " :refelemtype %u ", node->refelemtype); sprintf(buf, " :refelemtype %u ", node->refelemtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :refattrlength %d ", node->refattrlength); sprintf(buf, " :refattrlength %d ", node->refattrlength);
...@@ -883,7 +883,7 @@ _outFunc(StringInfo str, Func *node) ...@@ -883,7 +883,7 @@ _outFunc(StringInfo str, Func *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "FUNC"); appendStringInfo(str, " FUNC ");
sprintf(buf, " :funcid %u ", node->funcid); sprintf(buf, " :funcid %u ", node->funcid);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :functype %u ", node->functype); sprintf(buf, " :functype %u ", node->functype);
...@@ -910,7 +910,7 @@ _outOper(StringInfo str, Oper *node) ...@@ -910,7 +910,7 @@ _outOper(StringInfo str, Oper *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "OPER"); appendStringInfo(str, " OPER ");
sprintf(buf, " :opno %u ", node->opno); sprintf(buf, " :opno %u ", node->opno);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :opid %u ", node->opid); sprintf(buf, " :opid %u ", node->opid);
...@@ -928,7 +928,7 @@ _outParam(StringInfo str, Param *node) ...@@ -928,7 +928,7 @@ _outParam(StringInfo str, Param *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "PARAM"); appendStringInfo(str, " PARAM ");
sprintf(buf, " :paramkind %d ", node->paramkind); sprintf(buf, " :paramkind %d ", node->paramkind);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :paramid %d ", node->paramid); sprintf(buf, " :paramid %d ", node->paramid);
...@@ -954,7 +954,7 @@ _outEState(StringInfo str, EState *node) ...@@ -954,7 +954,7 @@ _outEState(StringInfo str, EState *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "ESTATE"); appendStringInfo(str, " ESTATE ");
sprintf(buf, " :direction %d ", node->es_direction); sprintf(buf, " :direction %d ", node->es_direction);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -975,7 +975,7 @@ _outRel(StringInfo str, Rel *node) ...@@ -975,7 +975,7 @@ _outRel(StringInfo str, Rel *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "REL"); appendStringInfo(str, " REL ");
appendStringInfo(str, " :relids "); appendStringInfo(str, " :relids ");
_outIntList(str, node->relids); _outIntList(str, node->relids);
...@@ -1039,7 +1039,7 @@ _outRel(StringInfo str, Rel *node) ...@@ -1039,7 +1039,7 @@ _outRel(StringInfo str, Rel *node)
static void static void
_outTargetEntry(StringInfo str, TargetEntry *node) _outTargetEntry(StringInfo str, TargetEntry *node)
{ {
appendStringInfo(str, "TLE"); appendStringInfo(str, " TLE ");
appendStringInfo(str, " :resdom "); appendStringInfo(str, " :resdom ");
_outNode(str, node->resdom); _outNode(str, node->resdom);
...@@ -1052,7 +1052,7 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node) ...@@ -1052,7 +1052,7 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "RTE"); appendStringInfo(str, " RTE ");
appendStringInfo(str, " :relname "); appendStringInfo(str, " :relname ");
appendStringInfo(str, node->relname); appendStringInfo(str, node->relname);
...@@ -1082,7 +1082,7 @@ _outPath(StringInfo str, Path *node) ...@@ -1082,7 +1082,7 @@ _outPath(StringInfo str, Path *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "PATH"); appendStringInfo(str, " PATH ");
sprintf(buf, " :pathtype %d ", node->pathtype); sprintf(buf, " :pathtype %d ", node->pathtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -1103,7 +1103,7 @@ _outIndexPath(StringInfo str, IndexPath *node) ...@@ -1103,7 +1103,7 @@ _outIndexPath(StringInfo str, IndexPath *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "INDEXPATH"); appendStringInfo(str, " INDEXPATH ");
sprintf(buf, " :pathtype %d ", node->path.pathtype); sprintf(buf, " :pathtype %d ", node->path.pathtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -1139,7 +1139,7 @@ _outJoinPath(StringInfo str, JoinPath *node) ...@@ -1139,7 +1139,7 @@ _outJoinPath(StringInfo str, JoinPath *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "JOINPATH"); appendStringInfo(str, " JOINPATH ");
sprintf(buf, " :pathtype %d ", node->path.pathtype); sprintf(buf, " :pathtype %d ", node->path.pathtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -1188,7 +1188,7 @@ _outMergePath(StringInfo str, MergePath *node) ...@@ -1188,7 +1188,7 @@ _outMergePath(StringInfo str, MergePath *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "MERGEPATH"); appendStringInfo(str, " MERGEPATH ");
sprintf(buf, " :pathtype %d ", node->jpath.path.pathtype); sprintf(buf, " :pathtype %d ", node->jpath.path.pathtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -1237,7 +1237,7 @@ _outHashPath(StringInfo str, HashPath *node) ...@@ -1237,7 +1237,7 @@ _outHashPath(StringInfo str, HashPath *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "HASHPATH"); appendStringInfo(str, " HASHPATH ");
sprintf(buf, " :pathtype %d ", node->jpath.path.pathtype); sprintf(buf, " :pathtype %d ", node->jpath.path.pathtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -1286,7 +1286,7 @@ _outOrderKey(StringInfo str, OrderKey *node) ...@@ -1286,7 +1286,7 @@ _outOrderKey(StringInfo str, OrderKey *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "ORDERKEY"); appendStringInfo(str, " ORDERKEY ");
sprintf(buf, " :attribute_number %d ", node->attribute_number); sprintf(buf, " :attribute_number %d ", node->attribute_number);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :array_index %d ", node->array_index); sprintf(buf, " :array_index %d ", node->array_index);
...@@ -1300,7 +1300,7 @@ _outOrderKey(StringInfo str, OrderKey *node) ...@@ -1300,7 +1300,7 @@ _outOrderKey(StringInfo str, OrderKey *node)
static void static void
_outJoinKey(StringInfo str, JoinKey *node) _outJoinKey(StringInfo str, JoinKey *node)
{ {
appendStringInfo(str, "JOINKEY"); appendStringInfo(str, " JOINKEY ");
appendStringInfo(str, " :outer "); appendStringInfo(str, " :outer ");
_outNode(str, node->outer); _outNode(str, node->outer);
...@@ -1318,7 +1318,7 @@ _outMergeOrder(StringInfo str, MergeOrder *node) ...@@ -1318,7 +1318,7 @@ _outMergeOrder(StringInfo str, MergeOrder *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "MERGEORDER"); appendStringInfo(str, " MERGEORDER ");
sprintf(buf, " :join_operator %d ", node->join_operator); sprintf(buf, " :join_operator %d ", node->join_operator);
appendStringInfo(str, buf); appendStringInfo(str, buf);
...@@ -1341,7 +1341,7 @@ _outCInfo(StringInfo str, CInfo *node) ...@@ -1341,7 +1341,7 @@ _outCInfo(StringInfo str, CInfo *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "CINFO"); appendStringInfo(str, " CINFO ");
appendStringInfo(str, " :clause "); appendStringInfo(str, " :clause ");
_outNode(str, node->clause); _outNode(str, node->clause);
...@@ -1368,7 +1368,7 @@ _outCInfo(StringInfo str, CInfo *node) ...@@ -1368,7 +1368,7 @@ _outCInfo(StringInfo str, CInfo *node)
static void static void
_outJoinMethod(StringInfo str, JoinMethod *node) _outJoinMethod(StringInfo str, JoinMethod *node)
{ {
appendStringInfo(str, "JOINMETHOD"); appendStringInfo(str, " JOINMETHOD ");
appendStringInfo(str, " :jmkeys "); appendStringInfo(str, " :jmkeys ");
_outNode(str, node->jmkeys); _outNode(str, node->jmkeys);
...@@ -1387,7 +1387,7 @@ _outHInfo(StringInfo str, HInfo *node) ...@@ -1387,7 +1387,7 @@ _outHInfo(StringInfo str, HInfo *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "HASHINFO"); appendStringInfo(str, " HASHINFO ");
appendStringInfo(str, " :hashop "); appendStringInfo(str, " :hashop ");
sprintf(buf, " %u ", node->hashop); sprintf(buf, " %u ", node->hashop);
...@@ -1407,7 +1407,7 @@ _outHInfo(StringInfo str, HInfo *node) ...@@ -1407,7 +1407,7 @@ _outHInfo(StringInfo str, HInfo *node)
static void static void
_outJInfo(StringInfo str, JInfo *node) _outJInfo(StringInfo str, JInfo *node)
{ {
appendStringInfo(str, "JINFO"); appendStringInfo(str, " JINFO ");
appendStringInfo(str, " :otherrels "); appendStringInfo(str, " :otherrels ");
_outIntList(str, node->otherrels); _outIntList(str, node->otherrels);
...@@ -1492,7 +1492,7 @@ _outDatum(StringInfo str, Datum value, Oid type) ...@@ -1492,7 +1492,7 @@ _outDatum(StringInfo str, Datum value, Oid type)
static void static void
_outIter(StringInfo str, Iter *node) _outIter(StringInfo str, Iter *node)
{ {
appendStringInfo(str, "ITER"); appendStringInfo(str, " ITER ");
appendStringInfo(str, " :iterexpr "); appendStringInfo(str, " :iterexpr ");
_outNode(str, node->iterexpr); _outNode(str, node->iterexpr);
...@@ -1503,7 +1503,7 @@ _outStream(StringInfo str, Stream *node) ...@@ -1503,7 +1503,7 @@ _outStream(StringInfo str, Stream *node)
{ {
char buf[500]; char buf[500];
appendStringInfo(str, "STREAM"); appendStringInfo(str, " STREAM ");
sprintf(buf, " :pathptr @ 0x%x ", (int) (node->pathptr)); sprintf(buf, " :pathptr @ 0x%x ", (int) (node->pathptr));
appendStringInfo(str, buf); appendStringInfo(str, buf);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.28 1998/02/26 04:32:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.29 1998/04/27 02:58:07 momjian Exp $
* *
* NOTES * NOTES
* Most of the read functions for plan nodes are tested. (In fact, they * Most of the read functions for plan nodes are tested. (In fact, they
...@@ -1978,188 +1978,187 @@ parsePlanString(void) ...@@ -1978,188 +1978,187 @@ parsePlanString(void)
token = lsptok(NULL, &length); token = lsptok(NULL, &length);
if (!strncmp(token, "PLAN", 4)) if (!strncmp(token, "PLAN", length))
{ {
return_value = _readPlan(); return_value = _readPlan();
} }
else if (!strncmp(token, "RESULT", 6)) else if (!strncmp(token, "RESULT", length))
{ {
return_value = _readResult(); return_value = _readResult();
} }
else if (!strncmp(token, "APPEND", 6)) else if (!strncmp(token, "APPEND", length))
{ {
return_value = _readAppend(); return_value = _readAppend();
} }
else if (!strncmp(token, "JOIN", 4)) else if (!strncmp(token, "JOIN", length))
{ {
return_value = _readJoin(); return_value = _readJoin();
} }
else if (!strncmp(token, "NESTLOOP", 8)) else if (!strncmp(token, "NESTLOOP", length))
{ {
return_value = _readNestLoop(); return_value = _readNestLoop();
} }
else if (!strncmp(token, "MERGEJOIN", 9)) else if (!strncmp(token, "MERGEJOIN", length))
{ {
return_value = _readMergeJoin(); return_value = _readMergeJoin();
} }
else if (!strncmp(token, "HASHJOIN", 8)) else if (!strncmp(token, "HASHJOIN", length))
{ {
return_value = _readHashJoin(); return_value = _readHashJoin();
} }
else if (!strncmp(token, "SCAN", 4)) else if (!strncmp(token, "SCAN", length))
{ {
return_value = _readScan(); return_value = _readScan();
} }
else if (!strncmp(token, "SEQSCAN", 7)) else if (!strncmp(token, "SEQSCAN", length))
{ {
return_value = _readSeqScan(); return_value = _readSeqScan();
} }
else if (!strncmp(token, "INDEXSCAN", 9)) else if (!strncmp(token, "INDEXSCAN", length))
{ {
return_value = _readIndexScan(); return_value = _readIndexScan();
} }
else if (!strncmp(token, "TEMP", 4)) else if (!strncmp(token, "TEMP", length))
{ {
return_value = _readTemp(); return_value = _readTemp();
} }
else if (!strncmp(token, "SORT", 4)) else if (!strncmp(token, "SORT", length))
{ {
return_value = _readSort(); return_value = _readSort();
} }
else if (!strncmp(token, "AGGREG", 6)) else if (!strncmp(token, "AGGREG", length))
{ {
return_value = _readAggreg(); return_value = _readAggreg();
} }
else if (!strncmp(token, "SUBLINK", 6)) else if (!strncmp(token, "SUBLINK", length))
{ {
return_value = _readSubLink(); return_value = _readSubLink();
} }
else if (!strncmp(token, "AGG", 3)) else if (!strncmp(token, "AGG", length))
{ {
return_value = _readAgg(); return_value = _readAgg();
} }
else if (!strncmp(token, "UNIQUE", 4)) else if (!strncmp(token, "UNIQUE", length))
{ {
return_value = _readUnique(); return_value = _readUnique();
} }
else if (!strncmp(token, "HASH", 4)) else if (!strncmp(token, "HASH", length))
{ {
return_value = _readHash(); return_value = _readHash();
} }
else if (!strncmp(token, "RESDOM", 6)) else if (!strncmp(token, "RESDOM", length))
{ {
return_value = _readResdom(); return_value = _readResdom();
} }
else if (!strncmp(token, "EXPR", 4)) else if (!strncmp(token, "EXPR", length))
{ {
return_value = _readExpr(); return_value = _readExpr();
} }
else if (!strncmp(token, "ARRAYREF", 7)) else if (!strncmp(token, "ARRAYREF", length))
{ {
/* make sure this strncmp is done before that of ARRAY */
return_value = _readArrayRef(); return_value = _readArrayRef();
} }
else if (!strncmp(token, "ARRAY", 5)) else if (!strncmp(token, "ARRAY", length))
{ {
return_value = _readArray(); return_value = _readArray();
} }
else if (!strncmp(token, "VAR", 3)) else if (!strncmp(token, "VAR", length))
{ {
return_value = _readVar(); return_value = _readVar();
} }
else if (!strncmp(token, "CONST", 5)) else if (!strncmp(token, "CONST", length))
{ {
return_value = _readConst(); return_value = _readConst();
} }
else if (!strncmp(token, "FUNC", 4)) else if (!strncmp(token, "FUNC", length))
{ {
return_value = _readFunc(); return_value = _readFunc();
} }
else if (!strncmp(token, "OPER", 4)) else if (!strncmp(token, "OPER", length))
{ {
return_value = _readOper(); return_value = _readOper();
} }
else if (!strncmp(token, "PARAM", 5)) else if (!strncmp(token, "PARAM", length))
{ {
return_value = _readParam(); return_value = _readParam();
} }
else if (!strncmp(token, "ESTATE", 6)) else if (!strncmp(token, "ESTATE", length))
{ {
return_value = _readEState(); return_value = _readEState();
} }
else if (!strncmp(token, "REL", 3)) else if (!strncmp(token, "REL", length))
{ {
return_value = _readRel(); return_value = _readRel();
} }
else if (!strncmp(token, "TLE", 3)) else if (!strncmp(token, "TLE", length))
{ {
return_value = _readTargetEntry(); return_value = _readTargetEntry();
} }
else if (!strncmp(token, "RTE", 3)) else if (!strncmp(token, "RTE", length))
{ {
return_value = _readRangeTblEntry(); return_value = _readRangeTblEntry();
} }
else if (!strncmp(token, "PATH", 4)) else if (!strncmp(token, "PATH", length))
{ {
return_value = _readPath(); return_value = _readPath();
} }
else if (!strncmp(token, "INDEXPATH", 9)) else if (!strncmp(token, "INDEXPATH", length))
{ {
return_value = _readIndexPath(); return_value = _readIndexPath();
} }
else if (!strncmp(token, "JOINPATH", 8)) else if (!strncmp(token, "JOINPATH", length))
{ {
return_value = _readJoinPath(); return_value = _readJoinPath();
} }
else if (!strncmp(token, "MERGEPATH", 9)) else if (!strncmp(token, "MERGEPATH", length))
{ {
return_value = _readMergePath(); return_value = _readMergePath();
} }
else if (!strncmp(token, "HASHPATH", 8)) else if (!strncmp(token, "HASHPATH", length))
{ {
return_value = _readHashPath(); return_value = _readHashPath();
} }
else if (!strncmp(token, "ORDERKEY", 8)) else if (!strncmp(token, "ORDERKEY", length))
{ {
return_value = _readOrderKey(); return_value = _readOrderKey();
} }
else if (!strncmp(token, "JOINKEY", 7)) else if (!strncmp(token, "JOINKEY", length))
{ {
return_value = _readJoinKey(); return_value = _readJoinKey();
} }
else if (!strncmp(token, "MERGEORDER", 10)) else if (!strncmp(token, "MERGEORDER", length))
{ {
return_value = _readMergeOrder(); return_value = _readMergeOrder();
} }
else if (!strncmp(token, "CINFO", 5)) else if (!strncmp(token, "CINFO", length))
{ {
return_value = _readCInfo(); return_value = _readCInfo();
} }
else if (!strncmp(token, "JOINMETHOD", 10)) else if (!strncmp(token, "JOINMETHOD", length))
{ {
return_value = _readJoinMethod(); return_value = _readJoinMethod();
} }
else if (!strncmp(token, "JINFO", 5)) else if (!strncmp(token, "JINFO", length))
{ {
return_value = _readJInfo(); return_value = _readJInfo();
} }
else if (!strncmp(token, "HINFO", 5)) else if (!strncmp(token, "HINFO", length))
{ {
return_value = _readHInfo(); return_value = _readHInfo();
} }
else if (!strncmp(token, "ITER", 4)) else if (!strncmp(token, "ITER", length))
{ {
return_value = _readIter(); return_value = _readIter();
} }
else if (!strncmp(token, "QUERY", 5)) else if (!strncmp(token, "QUERY", length))
{ {
return_value = _readQuery(); return_value = _readQuery();
} }
else if (!strncmp(token, "SORTCLAUSE", 10)) else if (!strncmp(token, "SORTCLAUSE", length))
{ {
return_value = _readSortClause(); return_value = _readSortClause();
} }
else if (!strncmp(token, "GROUPCLAUSE", 10)) else if (!strncmp(token, "GROUPCLAUSE", length))
{ {
return_value = _readGroupClause(); return_value = _readGroupClause();
} }
......
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