From 465e09da6310fee89946f3ca32ee8002dd4c428a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 23 May 2016 19:08:26 -0400 Subject: 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> --- src/include/pg_config_manual.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/include/pg_config_manual.h') diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h index 8d5a3783876..a2b2b614bec 100644 --- a/src/include/pg_config_manual.h +++ b/src/include/pg_config_manual.h @@ -273,6 +273,13 @@ */ /* #define COPY_PARSE_PLAN_TREES */ +/* + * Define this to force all raw parse trees for DML statements to be scanned + * by raw_expression_tree_walker(), to facilitate catching errors and + * omissions in that function. + */ +/* #define RAW_EXPRESSION_COVERAGE_TEST */ + /* * Enable debugging print statements for lock-related operations. */ -- cgit v1.2.3