diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-05-23 19:08:26 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-05-23 19:08:26 -0400 |
commit | 465e09da6310fee89946f3ca32ee8002dd4c428a (patch) | |
tree | 5022d50b6b7541f23641cdf9cbcdb8d7b0d5f8fb /src/backend/nodes/nodeFuncs.c | |
parent | 8a4930e3faffedf0c392de1f03508b816fa2244d (diff) | |
download | postgresql-465e09da6310fee89946f3ca32ee8002dd4c428a.tar.gz postgresql-465e09da6310fee89946f3ca32ee8002dd4c428a.zip |
Add support for more extensive testing of raw_expression_tree_walker().
If RAW_EXPRESSION_COVERAGE_TEST is defined, do a no-op tree walk over
every basic DML statement submitted to parse analysis. If we'd had this
in place earlier, bug #14153 would have been caught by buildfarm testing.
The difficulty is that raw_expression_tree_walker() is only used in
limited cases involving CTEs (particularly recursive ones), so it's
very easy for an oversight in it to not be noticed during testing of a
seemingly-unrelated feature.
The type of error we can expect to catch with this is complete omission
of a node type from raw_expression_tree_walker(), and perhaps also
recursion into a field that doesn't contain a node tree, though that
would be an unlikely mistake. It won't catch failure to add new fields
that need to be recursed into, unfortunately.
I'll go enable this on one or two of my own buildfarm animals once
bug #14153 is dealt with.
Discussion: <27861.1464040417@sss.pgh.pa.us>
Diffstat (limited to 'src/backend/nodes/nodeFuncs.c')
-rw-r--r-- | src/backend/nodes/nodeFuncs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c index 7bc5be1565f..92f32768f84 100644 --- a/src/backend/nodes/nodeFuncs.c +++ b/src/backend/nodes/nodeFuncs.c @@ -2991,8 +2991,10 @@ query_or_expression_tree_mutator(Node *node, * Unlike expression_tree_walker, there is no special rule about query * boundaries: we descend to everything that's possibly interesting. * - * Currently, the node type coverage extends to SelectStmt and everything - * that could appear under it, but not other statement types. + * Currently, the node type coverage here extends only to DML statements + * (SELECT/INSERT/UPDATE/DELETE) and nodes that can appear in them, because + * this is used mainly during analysis of CTEs, and only DML statements can + * appear in CTEs. */ bool raw_expression_tree_walker(Node *node, |