!2504 修复设置debug_print_plan,debug_print_parse,debug_print_rewritten日志级别仅在LOG和LOG以上使能的问题

Merge pull request !2504 from zhangao/master
This commit is contained in:
opengauss-bot
2022-12-01 12:03:11 +00:00
committed by Gitee
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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)