From 377f8830ae927b7582a1e5f78827eeb6e0683e62 Mon Sep 17 00:00:00 2001 From: chimyue Date: Sat, 12 Oct 2024 03:43:37 +0000 Subject: [PATCH] [CP] fix handle_physical_plan core caused by uninitialized ParseResult --- src/sql/ob_sql.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sql/ob_sql.cpp b/src/sql/ob_sql.cpp index 0a072efee..cd05b0785 100644 --- a/src/sql/ob_sql.cpp +++ b/src/sql/ob_sql.cpp @@ -1220,6 +1220,7 @@ int ObSql::do_real_prepare(const ObString &sql, int ret = OB_SUCCESS; bool enable_udr = false; ParseResult parse_result; + MEMSET(&parse_result, 0, SIZEOF(ParseResult)); ObStmt *basic_stmt = NULL; stmt::StmtType stmt_type = stmt::T_NONE; int64_t param_cnt = 0; @@ -1481,6 +1482,7 @@ int ObSql::handle_pl_prepare(const ObString &sql, int64_t param_cnt = 0; ObString normalized_sql; ParseResult parse_result; + MEMSET(&parse_result, 0, SIZEOF(ParseResult)); ObStmt *basic_stmt = NULL; int64_t cur_timeout_us = 0; stmt::StmtType stmt_type = stmt::T_NONE; @@ -5019,6 +5021,7 @@ int ObSql::pc_add_udr_plan(const ObUDRItemMgr::UDRItemRefGuard &item_guard, int get_plan_err = OB_SUCCESS; bool add_plan_to_pc = false; ParseResult parse_result; + MEMSET(&parse_result, 0, SIZEOF(ParseResult)); ObIAllocator &allocator = result.get_mem_pool(); ObSQLSessionInfo &session = result.get_session(); ObPlanCache *plan_cache = session.get_plan_cache(); @@ -5076,7 +5079,9 @@ OB_NOINLINE int ObSql::handle_physical_plan(const ObString &trimed_stmt, ObString signature_format_sql; ObOutlineState outline_state; ParseResult parse_result; + MEMSET(&parse_result, 0, SIZEOF(ParseResult)); ParseResult outline_parse_result; + MEMSET(&outline_parse_result, 0, SIZEOF(ParseResult)); bool add_plan_to_pc = false; bool is_match_udr = false; ObUDRItemMgr::UDRItemRefGuard item_guard;