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

Commit0ca27ea

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 parent7a2f70f commit0ca27ea

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
*/
@@ -3345,6 +3349,20 @@ _outParamRef(StringInfo str, const ParamRef *node)
33453349
WRITE_LOCATION_FIELD(location);
33463350
}
33473351

3352+
/*
3353+
* Node types found in raw parse trees (supported for debug purposes)
3354+
*/
3355+
3356+
staticvoid
3357+
_outRawStmt(StringInfostr,constRawStmt*node)
3358+
{
3359+
WRITE_NODE_TYPE("RAWSTMT");
3360+
3361+
WRITE_NODE_FIELD(stmt);
3362+
WRITE_LOCATION_FIELD(stmt_location);
3363+
WRITE_INT_FIELD(stmt_len);
3364+
}
3365+
33483366
staticvoid
33493367
_outAConst(StringInfostr,constA_Const*node)
33503368
{
@@ -4250,6 +4268,9 @@ outNode(StringInfo str, const void *obj)
42504268
caseT_ParamRef:
42514269
_outParamRef(str,obj);
42524270
break;
4271+
caseT_RawStmt:
4272+
_outRawStmt(str,obj);
4273+
break;
42534274
caseT_A_Const:
42544275
_outAConst(str,obj);
42554276
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp