|
15 | 15 | * have an output function defined here (as well as an input function
|
16 | 16 | * in readfuncs.c). In addition, plan nodes should have input and
|
17 | 17 | * output functions so that they can be sent to parallel workers.
|
| 18 | + * |
18 | 19 | * 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. |
21 | 25 | *
|
22 | 26 | *-------------------------------------------------------------------------
|
23 | 27 | */
|
@@ -3264,6 +3268,20 @@ _outParamRef(StringInfo str, const ParamRef *node)
|
3264 | 3268 | WRITE_LOCATION_FIELD(location);
|
3265 | 3269 | }
|
3266 | 3270 |
|
| 3271 | +/* |
| 3272 | + * Node types found in raw parse trees (supported for debug purposes) |
| 3273 | + */ |
| 3274 | + |
| 3275 | +static void |
| 3276 | +_outRawStmt(StringInfo str, const RawStmt *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 | + |
3267 | 3285 | static void
|
3268 | 3286 | _outAConst(StringInfo str, const A_Const *node)
|
3269 | 3287 | {
|
@@ -4154,6 +4172,9 @@ outNode(StringInfo str, const void *obj)
|
4154 | 4172 | case T_ParamRef:
|
4155 | 4173 | _outParamRef(str, obj);
|
4156 | 4174 | break;
|
| 4175 | + case T_RawStmt: |
| 4176 | + _outRawStmt(str, obj); |
| 4177 | + break; |
4157 | 4178 | case T_A_Const:
|
4158 | 4179 | _outAConst(str, obj);
|
4159 | 4180 | break;
|
|
0 commit comments