From 18eecad467a7ff4e94b2b18bb5ebe5c3bb48cf3f Mon Sep 17 00:00:00 2001 From: kenxx Date: Thu, 9 Mar 2023 21:01:17 -0500 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcopy=20to=E3=80=81copy=20from?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/cache/evtcache.cpp | 7 +++++-- src/gausskernel/process/tcop/utility.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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) {