From 0c5c988dafa05caa565f2d7bb1775041df39bb28 Mon Sep 17 00:00:00 2001 From: z00793368 Date: Tue, 29 Nov 2022 14:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E4=BB=85=E5=9C=A8LOG=E5=92=8CLOG=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E4=BD=BF=E8=83=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/nodes/print.cpp | 2 +- src/gausskernel/process/tcop/postgres.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/backend/nodes/print.cpp b/src/common/backend/nodes/print.cpp index 069bd8bcd..e58e0a3b3 100644 --- a/src/common/backend/nodes/print.cpp +++ b/src/common/backend/nodes/print.cpp @@ -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; diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 37e5a8c4c..cc6911257 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -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)