@ -622,8 +622,10 @@ pg_parse_query(const char *query_string)
if ( log_parser_stats )
if ( log_parser_stats )
ShowUsage ( " PARSER STATISTICS " ) ;
ShowUsage ( " PARSER STATISTICS " ) ;
# ifdef COPY_PARSE_PLAN_TREES
# ifdef DEBUG_NODE_TESTS_ENABLED
/* Optional debugging check: pass raw parsetrees through copyObject() */
/* Optional debugging check: pass raw parsetrees through copyObject() */
if ( Debug_copy_parse_plan_trees )
{
{
List * new_list = copyObject ( raw_parsetree_list ) ;
List * new_list = copyObject ( raw_parsetree_list ) ;
@ -633,13 +635,12 @@ pg_parse_query(const char *query_string)
else
else
raw_parsetree_list = new_list ;
raw_parsetree_list = new_list ;
}
}
# endif
/*
/*
* Optional debugging check : pass raw parsetrees through
* Optional debugging check : pass raw parsetrees through
* outfuncs / readfuncs
* outfuncs / readfuncs
*/
*/
# ifdef WRITE_READ_PARSE_PLAN_TREES
if ( Debug_write_read_parse_plan_trees )
{
{
char * str = nodeToStringWithLocations ( raw_parsetree_list ) ;
char * str = nodeToStringWithLocations ( raw_parsetree_list ) ;
List * new_list = stringToNodeWithLocations ( str ) ;
List * new_list = stringToNodeWithLocations ( str ) ;
@ -651,7 +652,8 @@ pg_parse_query(const char *query_string)
else
else
raw_parsetree_list = new_list ;
raw_parsetree_list = new_list ;
}
}
# endif
# endif /* DEBUG_NODE_TESTS_ENABLED */
TRACE_POSTGRESQL_QUERY_PARSE_DONE ( query_string ) ;
TRACE_POSTGRESQL_QUERY_PARSE_DONE ( query_string ) ;
@ -826,8 +828,10 @@ pg_rewrite_query(Query *query)
if ( log_parser_stats )
if ( log_parser_stats )
ShowUsage ( " REWRITER STATISTICS " ) ;
ShowUsage ( " REWRITER STATISTICS " ) ;
# ifdef COPY_PARSE_PLAN_TREES
# ifdef DEBUG_NODE_TESTS_ENABLED
/* Optional debugging check: pass querytree through copyObject() */
/* Optional debugging check: pass querytree through copyObject() */
if ( Debug_copy_parse_plan_trees )
{
{
List * new_list ;
List * new_list ;
@ -838,10 +842,9 @@ pg_rewrite_query(Query *query)
else
else
querytree_list = new_list ;
querytree_list = new_list ;
}
}
# endif
# ifdef WRITE_READ_PARSE_PLAN_TREES
/* Optional debugging check: pass querytree through outfuncs/readfuncs */
/* Optional debugging check: pass querytree through outfuncs/readfuncs */
if ( Debug_write_read_parse_plan_trees )
{
{
List * new_list = NIL ;
List * new_list = NIL ;
ListCell * lc ;
ListCell * lc ;
@ -868,7 +871,8 @@ pg_rewrite_query(Query *query)
else
else
querytree_list = new_list ;
querytree_list = new_list ;
}
}
# endif
# endif /* DEBUG_NODE_TESTS_ENABLED */
if ( Debug_print_rewritten )
if ( Debug_print_rewritten )
elog_node_display ( LOG , " rewritten parse tree " , querytree_list ,
elog_node_display ( LOG , " rewritten parse tree " , querytree_list ,
@ -906,8 +910,10 @@ pg_plan_query(Query *querytree, const char *query_string, int cursorOptions,
if ( log_planner_stats )
if ( log_planner_stats )
ShowUsage ( " PLANNER STATISTICS " ) ;
ShowUsage ( " PLANNER STATISTICS " ) ;
# ifdef COPY_PARSE_PLAN_TREES
# ifdef DEBUG_NODE_TESTS_ENABLED
/* Optional debugging check: pass plan tree through copyObject() */
/* Optional debugging check: pass plan tree through copyObject() */
if ( Debug_copy_parse_plan_trees )
{
{
PlannedStmt * new_plan = copyObject ( plan ) ;
PlannedStmt * new_plan = copyObject ( plan ) ;
@ -923,10 +929,9 @@ pg_plan_query(Query *querytree, const char *query_string, int cursorOptions,
# endif
# endif
plan = new_plan ;
plan = new_plan ;
}
}
# endif
# ifdef WRITE_READ_PARSE_PLAN_TREES
/* Optional debugging check: pass plan tree through outfuncs/readfuncs */
/* Optional debugging check: pass plan tree through outfuncs/readfuncs */
if ( Debug_write_read_parse_plan_trees )
{
{
char * str ;
char * str ;
PlannedStmt * new_plan ;
PlannedStmt * new_plan ;
@ -947,7 +952,8 @@ pg_plan_query(Query *querytree, const char *query_string, int cursorOptions,
# endif
# endif
plan = new_plan ;
plan = new_plan ;
}
}
# endif
# endif /* DEBUG_NODE_TESTS_ENABLED */
/*
/*
* Print plan if debugging .
* Print plan if debugging .