Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12d5c30

Browse files
author
Thomas G. Lockhart
committed
Add routines to print AExpr, Ident, and AConst parsing structures.
1 parent2c833a7 commit12d5c30

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+
staticvoid
1551+
_outAExpr(StringInfostr,A_Expr*node)
1552+
{
1553+
charbuf[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
staticvoid
15511563
_outValue(StringInfostr,Value*value)
15521564
{
@@ -1572,6 +1584,27 @@ _outValue(StringInfo str, Value *value)
15721584
return;
15731585
}
15741586

1587+
staticvoid
1588+
_outIdent(StringInfostr,Ident*node)
1589+
{
1590+
charbuf[500];
1591+
1592+
sprintf(buf,"IDENT %s",node->name);
1593+
appendStringInfo(str,buf);
1594+
return;
1595+
}
1596+
1597+
staticvoid
1598+
_outAConst(StringInfostr,A_Const*node)
1599+
{
1600+
charbuf[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
caseT_Float:
17641797
_outValue(str,obj);
17651798
break;
1799+
caseT_A_Expr:
1800+
_outAExpr(str,obj);
1801+
break;
1802+
caseT_Ident:
1803+
_outIdent(str,obj);
1804+
break;
1805+
caseT_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)

[8]ページ先頭

©2009-2025 Movatter.jp