diff --git a/src/common/backend/utils/cache/evtcache.cpp b/src/common/backend/utils/cache/evtcache.cpp index 9b34305d2..e8d90b366 100644 --- a/src/common/backend/utils/cache/evtcache.cpp +++ b/src/common/backend/utils/cache/evtcache.cpp @@ -232,7 +232,10 @@ static int DecodeTextArrayToCString(Datum array, char ***cstringp) */ static void InvalidateEventCacheCallback(Datum arg, int cacheid, uint32 hashvalue) { - MemoryContextReset(u_sess->exec_cxt.EventTriggerCacheContext); - u_sess->exec_cxt.EventTriggerCache = NULL; + /*Avoid repeated cache release,especially while rebuilding evtcache*/ + if (u_sess->exec_cxt.EventTriggerCache != NULL) { + MemoryContextReset(u_sess->exec_cxt.EventTriggerCacheContext); + u_sess->exec_cxt.EventTriggerCache = NULL; + } } diff --git a/src/gausskernel/process/tcop/utility.cpp b/src/gausskernel/process/tcop/utility.cpp index 36d50148d..9b1a60406 100755 --- a/src/gausskernel/process/tcop/utility.cpp +++ b/src/gausskernel/process/tcop/utility.cpp @@ -3201,7 +3201,7 @@ void standard_ProcessUtility(processutility_context* processutility_cxt, uint64 processed; uint64 histhash; bool has_histhash; - processed = DoCopy((CopyStmt*)parse_tree, query_string, &processed); + DoCopy((CopyStmt*)parse_tree, query_string, &processed); has_histhash = ((CopyStmt*)parse_tree)->hashstate.has_histhash; histhash = ((CopyStmt*)parse_tree)->hashstate.histhash; if (completion_tag != NULL) {