!2504 修复设置debug_print_plan,debug_print_parse,debug_print_rewritten日志级别仅在LOG和LOG以上使能的问题
Merge pull request !2504 from zhangao/master
This commit is contained in:
@ -242,7 +242,7 @@ char* pretty_format_node_dump(const char* dump)
|
||||
*/
|
||||
void format_debug_print_plan(char *force_line, int index, int length)
|
||||
{
|
||||
if (u_sess->attr.attr_sql.Debug_print_plan) {
|
||||
if (u_sess->attr.attr_sql.Debug_print_plan && u_sess->attr.attr_common.log_min_messages <= LOG) {
|
||||
char *result = NULL;
|
||||
char *encrypt = NULL;
|
||||
char *decrypt = NULL;
|
||||
|
||||
@ -1107,7 +1107,7 @@ static List* pg_rewrite_query(Query* query)
|
||||
List* querytree_list = NIL;
|
||||
PGSTAT_INIT_TIME_RECORD();
|
||||
|
||||
if (u_sess->attr.attr_sql.Debug_print_parse)
|
||||
if (u_sess->attr.attr_sql.Debug_print_parse && u_sess->attr.attr_common.log_min_messages <= LOG)
|
||||
elog_node_display(LOG, "parse tree", query, u_sess->attr.attr_sql.Debug_pretty_print);
|
||||
|
||||
if (u_sess->attr.attr_common.log_parser_stats)
|
||||
@ -1221,7 +1221,7 @@ static List* pg_rewrite_query(Query* query)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (u_sess->attr.attr_sql.Debug_print_rewritten)
|
||||
if (u_sess->attr.attr_sql.Debug_print_rewritten && u_sess->attr.attr_common.log_min_messages <= LOG)
|
||||
elog_node_display(LOG, "rewritten parse tree", querytree_list, u_sess->attr.attr_sql.Debug_pretty_print);
|
||||
|
||||
return querytree_list;
|
||||
@ -1317,7 +1317,7 @@ PlannedStmt* pg_plan_query(Query* querytree, int cursorOptions, ParamListInfo bo
|
||||
/*
|
||||
* Print plan if debugging.
|
||||
*/
|
||||
if (u_sess->attr.attr_sql.Debug_print_plan)
|
||||
if (u_sess->attr.attr_sql.Debug_print_plan && u_sess->attr.attr_common.log_min_messages <= LOG)
|
||||
elog_node_display(LOG, "plan", plan, u_sess->attr.attr_sql.Debug_pretty_print);
|
||||
|
||||
if (!underExplain)
|
||||
|
||||
Reference in New Issue
Block a user