File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -603,10 +603,22 @@ pg_parse_query(const char *query_string)
603
603
#endif
604
604
605
605
/*
606
- * Currently, outfuncs/readfuncs support is missing for many raw parse
607
- * tree nodes, so we don't try to implement WRITE_READ_PARSE_PLAN_TREES
608
- * here.
606
+ * Optional debugging check: pass raw parsetrees through
607
+ * outfuncs/readfuncs
609
608
*/
609
+ #ifdef WRITE_READ_PARSE_PLAN_TREES
610
+ {
611
+ char * str = nodeToString (raw_parsetree_list );
612
+ List * new_list = stringToNodeWithLocations (str );
613
+
614
+ pfree (str );
615
+ /* This checks both outfuncs/readfuncs and the equal() routines... */
616
+ if (!equal (new_list , raw_parsetree_list ))
617
+ elog (WARNING , "outfuncs/readfuncs failed to produce an equal raw parse tree" );
618
+ else
619
+ raw_parsetree_list = new_list ;
620
+ }
621
+ #endif
610
622
611
623
TRACE_POSTGRESQL_QUERY_PARSE_DONE (query_string );
612
624
You can’t perform that action at this time.
0 commit comments