From e6a854dc410c3599269c0225e8b9ab6e02715210 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Sat, 9 May 1998 23:46:35 +0000 Subject: [PATCH] Add some more node print routines for debugging only (inside of #ifdef PARSEDEBUG blocks). --- src/backend/nodes/outfuncs.c | 63 ++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index d322c8ee3e..c29730db2f 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.34 1998/04/27 02:58:05 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.35 1998/05/09 23:46:35 thomas Exp $ * * NOTES * Every (plan) node in POSTGRES has an associated "out" routine which @@ -45,6 +45,10 @@ #include "catalog/pg_type.h" #include "lib/stringinfo.h" +#ifdef PARSEDEBUG +#include "../parse.h" +#endif + static void _outDatum(StringInfo str, Datum value, Oid type); static void _outNode(StringInfo str, void *obj); @@ -107,6 +111,26 @@ _outIndexStmt(StringInfo str, IndexStmt *node) appendStringInfo(str, (node->unique ? "true" : "false")); } +#ifdef PARSEDEBUG +static void +_outSelectStmt(StringInfo str, SelectStmt *node) +{ + appendStringInfo(str, "SELECT"); + + appendStringInfo(str, " :where "); + _outNode(str, node->whereClause); +} + +static void +_outFuncCall(StringInfo str, FuncCall *node) +{ + appendStringInfo(str, "FUNCTION "); + appendStringInfo(str, node->funcname); + appendStringInfo(str, " :args "); + _outNode(str, node->args); +} +#endif + static void _outColumnDef(StringInfo str, ColumnDef *node) { @@ -1534,7 +1558,31 @@ static void _outAExpr(StringInfo str, A_Expr *node) { appendStringInfo(str, "EXPR "); - appendStringInfo(str, node->opname); +#ifdef PARSEDEBUG + switch (node->oper) + { + case AND: + appendStringInfo(str, "AND"); + break; + case OR: + appendStringInfo(str, "OR"); + break; + case NOT: + appendStringInfo(str, "NOT"); + break; + case ISNULL: + appendStringInfo(str, "ISNULL"); + break; + case NOTNULL: + appendStringInfo(str, "NOTNULL"); + break; + default: +#endif + appendStringInfo(str, node->opname); +#ifdef PARSEDEBUG + break; + } +#endif _outNode(str, node->lexpr); _outNode(str, node->rexpr); return; @@ -1634,6 +1682,17 @@ _outNode(StringInfo str, void *obj) _outIndexElem(str, obj); 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: _outQuery(str, obj); break; -- 2.40.0