Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 12d5c30

Browse files
author
Thomas G. Lockhart
committed
Add routines to print AExpr, Ident, and AConst parsing structures.
1 parent 2c833a7 commit 12d5c30

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.12 1997/12/18 12:53:51 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.13 1997/12/23 19:50:54 thomas Exp $
1111
*
1212
* NOTES
1313
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -1547,6 +1547,18 @@ _outStream(StringInfo str, Stream *node)
15471547
appendStringInfo(str, buf);
15481548
}
15491549

1550+
static void
1551+
_outAExpr(StringInfo str, A_Expr *node)
1552+
{
1553+
char buf[500];
1554+
1555+
sprintf(buf, "EXPR %s", node->opname);
1556+
appendStringInfo(str, buf);
1557+
_outNode(str, node->lexpr);
1558+
_outNode(str, node->rexpr);
1559+
return;
1560+
}
1561+
15501562
static void
15511563
_outValue(StringInfo str, Value *value)
15521564
{
@@ -1572,6 +1584,27 @@ _outValue(StringInfo str, Value *value)
15721584
return;
15731585
}
15741586

1587+
static void
1588+
_outIdent(StringInfo str, Ident *node)
1589+
{
1590+
char buf[500];
1591+
1592+
sprintf(buf, "IDENT %s", node->name);
1593+
appendStringInfo(str, buf);
1594+
return;
1595+
}
1596+
1597+
static void
1598+
_outAConst(StringInfo str, A_Const *node)
1599+
{
1600+
char buf[500];
1601+
1602+
sprintf(buf, "CONST ");
1603+
appendStringInfo(str, buf);
1604+
_outValue(str, &(node->val));
1605+
return;
1606+
}
1607+
15751608
/*
15761609
* _outNode -
15771610
* converts a Node into ascii string and append it to 'str'
@@ -1763,6 +1796,15 @@ _outNode(StringInfo str, void *obj)
17631796
case T_Float:
17641797
_outValue(str, obj);
17651798
break;
1799+
case T_A_Expr:
1800+
_outAExpr(str, obj);
1801+
break;
1802+
case T_Ident:
1803+
_outIdent(str, obj);
1804+
break;
1805+
case T_A_Const:
1806+
_outAConst(str, obj);
1807+
break;
17661808
default:
17671809
elog(NOTICE, "_outNode: don't know how to print type %d",
17681810
nodeTag(obj));

0 commit comments

Comments
 (0)