From 7d150eca15df65156a8089bd0bbe967ef1f3bc39 Mon Sep 17 00:00:00 2001 From: obdev Date: Thu, 5 May 2022 14:20:59 +0800 Subject: [PATCH] =?UTF-8?q?[CP]=20=E3=80=90asan=E3=80=91G349509=20ObExpr::?= =?UTF-8?q?do=5Feval=5Fbatch=20stack-use-after-scope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sql/engine/expr/ob_datum_cast.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sql/engine/expr/ob_datum_cast.cpp b/src/sql/engine/expr/ob_datum_cast.cpp index eb6cf0d34b..e9d6e1be1d 100644 --- a/src/sql/engine/expr/ob_datum_cast.cpp +++ b/src/sql/engine/expr/ob_datum_cast.cpp @@ -256,6 +256,7 @@ int ObDatumHexUtils::rawtohex(const ObExpr& expr, const ObString& in_str, ObEval } else { ObIAllocator& tmp_alloc = ctx.get_reset_tmp_alloc(); ObString out_str; + ObOTimestampData time_in_val; switch (in_type) { // TODO::this should same as oracle, and support dump func case ObTinyIntType: @@ -300,16 +301,15 @@ int ObDatumHexUtils::rawtohex(const ObExpr& expr, const ObString& in_str, ObEval case ObTimestampTZType: case ObTimestampLTZType: case ObTimestampNanoType: { - ObOTimestampData in_val; // ObTimestampTZType is 12 bytes, ObTimestampLTZType and ObTimestampNanoType is 10 bytes // so it needs to be distinguished ObDatum tmp_datum; tmp_datum.ptr_ = in_str.ptr(); tmp_datum.pack_ = static_cast(in_str.length()); - if (OB_FAIL(common_construct_otimestamp(in_type, tmp_datum, in_val))) { + if (OB_FAIL(common_construct_otimestamp(in_type, tmp_datum, time_in_val))) { LOG_WARN("common_construct_otimestamp failed", K(ret)); } else { - out_str.assign_ptr(reinterpret_cast(&in_val), static_cast(in_str.length())); + out_str.assign_ptr(reinterpret_cast(&time_in_val), static_cast(in_str.length())); } break; } -- GitLab