diff --git a/src/observer/mysql/obmp_query.cpp b/src/observer/mysql/obmp_query.cpp index 6c0860fdb8..972fa24786 100644 --- a/src/observer/mysql/obmp_query.cpp +++ b/src/observer/mysql/obmp_query.cpp @@ -498,6 +498,7 @@ int ObMPQuery::process_single_stmt(const ObMultiStmtItem &multi_stmt_item, { int ret = OB_SUCCESS; FLTSpanGuard(mpquery_single_stmt); + ctx_.spm_ctx_.reset(); bool need_response_error = true; const bool enable_trace_log = lib::is_trace_log_enabled(); session.get_raw_audit_record().request_memory_used_ = 0; diff --git a/src/sql/ob_sql_context.h b/src/sql/ob_sql_context.h index d9d1cdcbd4..04f3cb853b 100644 --- a/src/sql/ob_sql_context.h +++ b/src/sql/ob_sql_context.h @@ -416,6 +416,7 @@ struct ObSpmCacheCtx ObSpmCacheCtx() : bl_key_() {} + inline void reset() { bl_key_.reset(); } ObBaselineKey bl_key_; }; diff --git a/src/sql/spm/ob_spm_define.h b/src/sql/spm/ob_spm_define.h index f639867363..6fa5685021 100644 --- a/src/sql/spm/ob_spm_define.h +++ b/src/sql/spm/ob_spm_define.h @@ -297,6 +297,7 @@ struct ObSpmCacheCtx : public ObILibCacheCtx BASELINE_PLAN, MAX_TYPE }; + void reset(); void set_get_normal_mode(uint64_t v) { plan_hash_value_ = v; handle_cache_mode_ = MODE_GET_NORMAL; } void set_get_offset_mode() { handle_cache_mode_ = MODE_GET_OFFSET; } void set_get_for_update_mode(uint64_t v) { plan_hash_value_ = v; handle_cache_mode_ = MODE_GET_FOR_UPDATE; }