Skip to content

Commit 9fd2802

Browse files
author
Thomas G. Lockhart
committed
Add a few other parser-only nodes for debugging help.
Define the JoinExpr node.
1 parent 0a8e9c4 commit 9fd2802

File tree

1 file changed

+32
-22
lines changed

1 file changed

+32
-22
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: outfuncs.c,v 1.75 1999/02/18 00:49:14 momjian Exp $
8+
* $Id: outfuncs.c,v 1.76 1999/02/23 08:01:47 thomas Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -42,9 +42,7 @@
4242
#include "catalog/pg_type.h"
4343
#include "lib/stringinfo.h"
4444

45-
#ifdef PARSEDEBUG
4645
#include "../parse.h"
47-
#endif
4846

4947
static void _outDatum(StringInfo str, Datum value, Oid type);
5048
static void _outNode(StringInfo str, void *obj);
@@ -109,7 +107,6 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
109107
node->unique ? "true" : "false");
110108
}
111109

112-
#ifdef PARSEDEBUG
113110
static void
114111
_outSelectStmt(StringInfo str, SelectStmt *node)
115112
{
@@ -124,8 +121,6 @@ _outFuncCall(StringInfo str, FuncCall *node)
124121
_outNode(str, node->args);
125122
}
126123

127-
#endif
128-
129124
static void
130125
_outColumnDef(StringInfo str, ColumnDef *node)
131126
{
@@ -1293,7 +1288,6 @@ static void
12931288
_outAExpr(StringInfo str, A_Expr *node)
12941289
{
12951290
appendStringInfo(str, "EXPR ");
1296-
#ifdef PARSEDEBUG
12971291
switch (node->oper)
12981292
{
12991293
case AND:
@@ -1312,12 +1306,9 @@ _outAExpr(StringInfo str, A_Expr *node)
13121306
appendStringInfo(str, "NOTNULL");
13131307
break;
13141308
default:
1315-
#endif
13161309
appendStringInfo(str, stringStringInfo(node->opname));
1317-
#ifdef PARSEDEBUG
13181310
break;
13191311
}
1320-
#endif
13211312
_outNode(str, node->lexpr);
13221313
_outNode(str, node->rexpr);
13231314
return;
@@ -1350,6 +1341,24 @@ _outIdent(StringInfo str, Ident *node)
13501341
return;
13511342
}
13521343

1344+
static void
1345+
_outAttr(StringInfo str, Attr *node)
1346+
{
1347+
List *l;
1348+
1349+
appendStringInfo(str, " ATTR \"%s\" ", stringStringInfo(node->relname));
1350+
1351+
appendStringInfo(str, "(");
1352+
foreach(l, node->attrs)
1353+
{
1354+
_outNode(str, lfirst(l));
1355+
if (lnext(l))
1356+
appendStringInfo(str, ",");
1357+
}
1358+
appendStringInfo(str, ")");
1359+
return;
1360+
}
1361+
13531362
static void
13541363
_outAConst(StringInfo str, A_Const *node)
13551364
{
@@ -1465,18 +1474,6 @@ _outNode(StringInfo str, void *obj)
14651474
case T_IndexElem:
14661475
_outIndexElem(str, obj);
14671476
break;
1468-
1469-
#ifdef PARSEDEBUG
1470-
case T_VariableSetStmt:
1471-
break;
1472-
case T_SelectStmt:
1473-
_outSelectStmt(str, obj);
1474-
break;
1475-
case T_FuncCall:
1476-
_outFuncCall(str, obj);
1477-
break;
1478-
#endif
1479-
14801477
case T_Query:
14811478
_outQuery(str, obj);
14821479
break;
@@ -1659,6 +1656,19 @@ _outNode(StringInfo str, void *obj)
16591656
case T_CaseWhen:
16601657
_outCaseWhen(str, obj);
16611658
break;
1659+
1660+
case T_VariableSetStmt:
1661+
break;
1662+
case T_SelectStmt:
1663+
_outSelectStmt(str, obj);
1664+
break;
1665+
case T_FuncCall:
1666+
_outFuncCall(str, obj);
1667+
break;
1668+
case T_Attr:
1669+
_outAttr(str, obj);
1670+
break;
1671+
16621672
default:
16631673
elog(NOTICE, "_outNode: don't know how to print type %d ",
16641674
nodeTag(obj));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy