diff --git a/src/common/backend/pgxc_single/pool/execRemote.cpp b/src/common/backend/pgxc_single/pool/execRemote.cpp index 00f7488f7..7037b5727 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"))); } }