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

Commit3844adb

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 parentda1db40 commit3844adb

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
*/
@@ -3347,6 +3351,20 @@ _outParamRef(StringInfo str, const ParamRef *node)
33473351
WRITE_LOCATION_FIELD(location);
33483352
}
33493353

3354+
/*
3355+
* Node types found in raw parse trees (supported for debug purposes)
3356+
*/
3357+
3358+
staticvoid
3359+
_outRawStmt(StringInfostr,constRawStmt*node)
3360+
{
3361+
WRITE_NODE_TYPE("RAWSTMT");
3362+
3363+
WRITE_NODE_FIELD(stmt);
3364+
WRITE_LOCATION_FIELD(stmt_location);
3365+
WRITE_INT_FIELD(stmt_len);
3366+
}
3367+
33503368
staticvoid
33513369
_outAConst(StringInfostr,constA_Const*node)
33523370
{
@@ -4252,6 +4270,9 @@ outNode(StringInfo str, const void *obj)
42524270
caseT_ParamRef:
42534271
_outParamRef(str,obj);
42544272
break;
4273+
caseT_RawStmt:
4274+
_outRawStmt(str,obj);
4275+
break;
42554276
caseT_A_Const:
42564277
_outAConst(str,obj);
42574278
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp