From c477ed5163fefa4fc116c1d0991feb824c502454 Mon Sep 17 00:00:00 2001 From: duzhuolin Date: Fri, 28 Jul 2023 15:04:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9spi=5Fpriv=E3=80=81execRemote?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/pgxc_single/pool/execRemote.cpp | 4 ++-- src/include/executor/spi_priv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/backend/pgxc_single/pool/execRemote.cpp b/src/common/backend/pgxc_single/pool/execRemote.cpp index cb6d6577f..3568ab9db 100755 --- a/src/common/backend/pgxc_single/pool/execRemote.cpp +++ b/src/common/backend/pgxc_single/pool/execRemote.cpp @@ -5299,11 +5299,11 @@ void do_query_for_first_tuple(RemoteQueryState* node, bool vectorized, int regul pfree_ext(node->cursor_connections); if (!node->need_error_check) { - int error_code; + int error_code = 0; char* error_msg = getSocketError(&error_code); ereport(ERROR, - (errcode(error_code), errmsg("Failed to read response from Datanodes Detail: %s\n", error_msg))); + (errcode(error_code), errmsg("Failed to read response from Datanodes Detail: %s\n", error_msg == NULL ? "null" : error_msg))); } else { node->need_error_check = false; pgxc_node_report_error(node); diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h index 5b7e9ef86..e7f99af22 100644 --- a/src/include/executor/spi_priv.h +++ b/src/include/executor/spi_priv.h @@ -110,7 +110,7 @@ inline void spi_stack_record_log(const char* action, const char* filename, int l ereport(DEBUG3, (errmodule(MOD_SPI), errcode(ERRCODE_LOG), errmsg("SPISTACK(Action:%s, Location %s,%d, Funcname:%s): cur spiconnected:%d, cur spi:%d, query string:%s", action, filename, lineno, funcname, u_sess->SPI_cxt._connected, u_sess->SPI_cxt._curid, - query != NULL ? maskPassword(query) : NULL))); + query != NULL ? maskPassword(query) : "null"))); } }