From c4d9c5a935d20403784aff8ed4272ba98ccc66e9 Mon Sep 17 00:00:00 2001 From: hwhbj Date: Wed, 25 Sep 2024 09:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3sql=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=9C=BA=E6=99=AF=E4=B8=8Bog=5Frecord=5Ftime?= =?UTF-8?q?.cpp=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=EF=BC=88cherry=20picked=20commit=20from=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/og_record_time.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/process/postmaster/og_record_time.cpp b/src/gausskernel/process/postmaster/og_record_time.cpp index 1dcc124e0..e17877b85 100644 --- a/src/gausskernel/process/postmaster/og_record_time.cpp +++ b/src/gausskernel/process/postmaster/og_record_time.cpp @@ -403,7 +403,7 @@ OgRecordAutoController::OgRecordAutoController(TimeInfoType time_info_type) time_info = time_info_type; bool report_enable = OgRecordAutoController::report_enable(); if (report_enable) { - MemoryContext old = MemoryContextSwitchTo(SESS_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_DEFAULT)); + MemoryContext old = MemoryContextSwitchTo(u_sess->temp_mem_cxt); og_operator = New(CurrentMemoryContext) OgRecordOperator(time_info); MemoryContextSwitchTo(old); } else { @@ -414,7 +414,7 @@ OgRecordAutoController::OgRecordAutoController(TimeInfoType time_info_type) OgRecordAutoController::~OgRecordAutoController() { if (og_operator != NULL && u_sess != NULL) { - MemoryContext old = MemoryContextSwitchTo(SESS_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_DEFAULT)); + MemoryContext old = MemoryContextSwitchTo(u_sess->temp_mem_cxt); DELETE_EX_TYPE(og_operator,OgRecordOperator); MemoryContextSwitchTo(old); }