Add a few other parser-only nodes for debugging help.
Define the JoinExpr node.
This commit is contained in:
parent
0a8e9c4e7f
commit
9fd28029eb
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: outfuncs.c,v 1.75 1999/02/18 00:49:14 momjian Exp $
|
* $Id: outfuncs.c,v 1.76 1999/02/23 08:01:47 thomas 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
|
||||||
@ -42,9 +42,7 @@
|
|||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "lib/stringinfo.h"
|
#include "lib/stringinfo.h"
|
||||||
|
|
||||||
#ifdef PARSEDEBUG
|
|
||||||
#include "../parse.h"
|
#include "../parse.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
static void _outDatum(StringInfo str, Datum value, Oid type);
|
static void _outDatum(StringInfo str, Datum value, Oid type);
|
||||||
static void _outNode(StringInfo str, void *obj);
|
static void _outNode(StringInfo str, void *obj);
|
||||||
@ -109,7 +107,6 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
|
|||||||
node->unique ? "true" : "false");
|
node->unique ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PARSEDEBUG
|
|
||||||
static void
|
static void
|
||||||
_outSelectStmt(StringInfo str, SelectStmt *node)
|
_outSelectStmt(StringInfo str, SelectStmt *node)
|
||||||
{
|
{
|
||||||
@ -124,8 +121,6 @@ _outFuncCall(StringInfo str, FuncCall *node)
|
|||||||
_outNode(str, node->args);
|
_outNode(str, node->args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outColumnDef(StringInfo str, ColumnDef *node)
|
_outColumnDef(StringInfo str, ColumnDef *node)
|
||||||
{
|
{
|
||||||
@ -1293,7 +1288,6 @@ static void
|
|||||||
_outAExpr(StringInfo str, A_Expr *node)
|
_outAExpr(StringInfo str, A_Expr *node)
|
||||||
{
|
{
|
||||||
appendStringInfo(str, "EXPR ");
|
appendStringInfo(str, "EXPR ");
|
||||||
#ifdef PARSEDEBUG
|
|
||||||
switch (node->oper)
|
switch (node->oper)
|
||||||
{
|
{
|
||||||
case AND:
|
case AND:
|
||||||
@ -1312,12 +1306,9 @@ _outAExpr(StringInfo str, A_Expr *node)
|
|||||||
appendStringInfo(str, "NOTNULL");
|
appendStringInfo(str, "NOTNULL");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
#endif
|
|
||||||
appendStringInfo(str, stringStringInfo(node->opname));
|
appendStringInfo(str, stringStringInfo(node->opname));
|
||||||
#ifdef PARSEDEBUG
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
_outNode(str, node->lexpr);
|
_outNode(str, node->lexpr);
|
||||||
_outNode(str, node->rexpr);
|
_outNode(str, node->rexpr);
|
||||||
return;
|
return;
|
||||||
@ -1350,6 +1341,24 @@ _outIdent(StringInfo str, Ident *node)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_outAttr(StringInfo str, Attr *node)
|
||||||
|
{
|
||||||
|
List *l;
|
||||||
|
|
||||||
|
appendStringInfo(str, " ATTR \"%s\" ", stringStringInfo(node->relname));
|
||||||
|
|
||||||
|
appendStringInfo(str, "(");
|
||||||
|
foreach(l, node->attrs)
|
||||||
|
{
|
||||||
|
_outNode(str, lfirst(l));
|
||||||
|
if (lnext(l))
|
||||||
|
appendStringInfo(str, ",");
|
||||||
|
}
|
||||||
|
appendStringInfo(str, ")");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outAConst(StringInfo str, A_Const *node)
|
_outAConst(StringInfo str, A_Const *node)
|
||||||
{
|
{
|
||||||
@ -1465,18 +1474,6 @@ _outNode(StringInfo str, void *obj)
|
|||||||
case T_IndexElem:
|
case T_IndexElem:
|
||||||
_outIndexElem(str, obj);
|
_outIndexElem(str, obj);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef PARSEDEBUG
|
|
||||||
case T_VariableSetStmt:
|
|
||||||
break;
|
|
||||||
case T_SelectStmt:
|
|
||||||
_outSelectStmt(str, obj);
|
|
||||||
break;
|
|
||||||
case T_FuncCall:
|
|
||||||
_outFuncCall(str, obj);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case T_Query:
|
case T_Query:
|
||||||
_outQuery(str, obj);
|
_outQuery(str, obj);
|
||||||
break;
|
break;
|
||||||
@ -1659,6 +1656,19 @@ _outNode(StringInfo str, void *obj)
|
|||||||
case T_CaseWhen:
|
case T_CaseWhen:
|
||||||
_outCaseWhen(str, obj);
|
_outCaseWhen(str, obj);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_VariableSetStmt:
|
||||||
|
break;
|
||||||
|
case T_SelectStmt:
|
||||||
|
_outSelectStmt(str, obj);
|
||||||
|
break;
|
||||||
|
case T_FuncCall:
|
||||||
|
_outFuncCall(str, obj);
|
||||||
|
break;
|
||||||
|
case T_Attr:
|
||||||
|
_outAttr(str, obj);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
elog(NOTICE, "_outNode: don't know how to print type %d ",
|
elog(NOTICE, "_outNode: don't know how to print type %d ",
|
||||||
nodeTag(obj));
|
nodeTag(obj));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user