From 6621db029e8fa1d0202c78e56f7cc6f39f4ea1b8 Mon Sep 17 00:00:00 2001 From: fkuner <784819644@qq.com> Date: Wed, 3 Apr 2024 03:15:37 +0000 Subject: [PATCH] [OBCDC] avoid get timezone repeatedly in formatter --- src/logservice/libobcdc/src/ob_obj2str_helper.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/logservice/libobcdc/src/ob_obj2str_helper.cpp b/src/logservice/libobcdc/src/ob_obj2str_helper.cpp index 6b2c41c403..6f616f48ba 100644 --- a/src/logservice/libobcdc/src/ob_obj2str_helper.cpp +++ b/src/logservice/libobcdc/src/ob_obj2str_helper.cpp @@ -226,19 +226,13 @@ int ObObj2strHelper::obj2str(const uint64_t tenant_id, if (OB_SUCC(ret)) { common::ObObj str_obj; common::ObObjType target_type = common::ObMaxType; - ObCDCTenantTimeZoneInfo *obcdc_tenant_tz_info = nullptr; - if (OB_ISNULL(timezone_info_getter_)) { + if (OB_ISNULL(tz_info_wrap)) { ret = OB_ERR_UNEXPECTED; - OBLOG_LOG(ERROR, "timezone_info_getter_ is null", K(timezone_info_getter_)); - } else if (OB_FAIL(timezone_info_getter_->get_tenant_tz_info(tenant_id, obcdc_tenant_tz_info))) { - OBLOG_LOG(ERROR, "get_tenant_tz_wrap failed", KR(ret), K(tenant_id)); - } else if (OB_ISNULL(obcdc_tenant_tz_info)) { - ret = OB_ERR_UNEXPECTED; - OBLOG_LOG(ERROR, "tenant_tz_info not valid", KR(ret), K(tenant_id)); + OBLOG_LOG(ERROR, "tz_info_wrap is nullptr", K(tenant_id), K(table_id), K(tz_info_wrap)); } else { // obcdc need use_standard_format - const common::ObTimeZoneInfo *tz_info = obcdc_tenant_tz_info->get_timezone_info(); + const common::ObTimeZoneInfo *tz_info = tz_info_wrap->get_time_zone_info(); const ObDataTypeCastParams dtc_params(tz_info); ObObjCastParams cast_param(&allocator, &dtc_params, CM_NONE, collation_type); cast_param.format_number_with_limit_ = false;//here need no limit format number for libobcdc