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

Commitc374017

Browse files
committed
Add outfuncs.c support for RawStmt nodes.
I noticed while poking at a report from Andrey Lepikhov that therecent addition of RawStmt nodes at the top of raw parse treesmakes it impossible to print any raw parse trees whatsoever,because outfuncs.c doesn't know RawStmt and hence fails to descendinto it.While we generally lack outfuncs.c support for utility statements,there is reasonably complete support for what you can find in araw SELECT statement. It was not my intention to make that alldead code ... so let's add support for RawStmt.Back-patch to v10 where RawStmt appeared.
1 parent99cbbbb commitc374017

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

‎src/backend/nodes/outfuncs.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
* have an output function defined here (as well as an input function
1616
* in readfuncs.c). In addition, plan nodes should have input and
1717
* output functions so that they can be sent to parallel workers.
18+
*
1819
* For use in debugging, we also provide output functions for nodes
19-
* that appear in raw parsetrees and path. These nodes however need
20-
* not have input functions.
20+
* that appear in raw parsetrees and planner Paths. These node types
21+
* need not have input functions. Output support for raw parsetrees
22+
* is somewhat incomplete, too; in particular, utility statements are
23+
* almost entirely unsupported. We try to support everything that can
24+
* appear in a raw SELECT, though.
2125
*
2226
*-------------------------------------------------------------------------
2327
*/
@@ -3264,6 +3268,20 @@ _outParamRef(StringInfo str, const ParamRef *node)
32643268
WRITE_LOCATION_FIELD(location);
32653269
}
32663270

3271+
/*
3272+
* Node types found in raw parse trees (supported for debug purposes)
3273+
*/
3274+
3275+
staticvoid
3276+
_outRawStmt(StringInfostr,constRawStmt*node)
3277+
{
3278+
WRITE_NODE_TYPE("RAWSTMT");
3279+
3280+
WRITE_NODE_FIELD(stmt);
3281+
WRITE_LOCATION_FIELD(stmt_location);
3282+
WRITE_INT_FIELD(stmt_len);
3283+
}
3284+
32673285
staticvoid
32683286
_outAConst(StringInfostr,constA_Const*node)
32693287
{
@@ -4154,6 +4172,9 @@ outNode(StringInfo str, const void *obj)
41544172
caseT_ParamRef:
41554173
_outParamRef(str,obj);
41564174
break;
4175+
caseT_RawStmt:
4176+
_outRawStmt(str,obj);
4177+
break;
41574178
caseT_A_Const:
41584179
_outAConst(str,obj);
41594180
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp