diff --git a/src/share/ob_lob_access_utils.cpp b/src/share/ob_lob_access_utils.cpp index 5ff5645ab6..1602bb35aa 100644 --- a/src/share/ob_lob_access_utils.cpp +++ b/src/share/ob_lob_access_utils.cpp @@ -990,8 +990,9 @@ int ObTextStringIter::convert_outrow_lob_to_inrow_templob(const ObObj &in_obj, // ----- implementations of ObTextStringResult ----- -void ObTextStringResult::calc_buffer_len(int64_t res_len) +int ObTextStringResult::calc_buffer_len(int64_t res_len) { + int ret = OB_SUCCESS; if (!(is_lob_storage(type_))) { // tinytext no has lob header buff_len_ = res_len; } else { @@ -1004,10 +1005,12 @@ void ObTextStringResult::calc_buffer_len(int64_t res_len) res_len += sizeof(ObLobCommon); buff_len_ = ObLobLocatorV2::calc_locator_full_len(extern_flags, 0, static_cast(res_len), false); } else { - LOG_WARN_RET(OB_NOT_IMPLEMENT, "Lob: out row temp lob not implemented", - K(OB_NOT_IMPLEMENT), K(this), K(pos_), K(buff_len_)); + ret = OB_SIZE_OVERFLOW; + LOG_WARN("Lob: out row temp lob not implemented, not support length bigger than 512M", + K(ret), K(this), K(pos_), K(buff_len_), K(res_len)); } } + return ret; } int ObTextStringResult::fill_temp_lob_header(const int64_t res_len) @@ -1053,7 +1056,8 @@ int ObTextStringResult::init(int64_t res_len, ObIAllocator *allocator) } else if (!(ob_is_string_or_lob_type(type_) || ob_is_json(type_))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("Lob: unexpected expr result type for textstring result", K(ret), K(type_)); - } else if (FALSE_IT(calc_buffer_len(res_len))) { + } else if (OB_FAIL(calc_buffer_len(res_len))) { + LOG_WARN("fail to calc buffer len", K(ret), K(res_len)); } else if (buff_len_ == 0) { OB_ASSERT(has_lob_header_ == false); // empty result without header } else { diff --git a/src/share/ob_lob_access_utils.h b/src/share/ob_lob_access_utils.h index 2b83341c38..cace8dfd36 100644 --- a/src/share/ob_lob_access_utils.h +++ b/src/share/ob_lob_access_utils.h @@ -267,7 +267,7 @@ public: ObIAllocator &allocator); protected: - void calc_buffer_len(const int64_t res_len); + int calc_buffer_len(const int64_t res_len); int fill_temp_lob_header(const int64_t res_len); protected: diff --git a/src/sql/engine/expr/ob_expr_lob_utils.cpp b/src/sql/engine/expr/ob_expr_lob_utils.cpp index 6def422b15..f99cc24eb9 100644 --- a/src/sql/engine/expr/ob_expr_lob_utils.cpp +++ b/src/sql/engine/expr/ob_expr_lob_utils.cpp @@ -35,8 +35,8 @@ int ObTextStringDatumResult::init(int64_t res_len, ObIAllocator *allocator) } else if((OB_ISNULL(res_datum_))) { ret = OB_INVALID_ARGUMENT; LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KPC(res_datum_)); - } else if (FALSE_IT(ObTextStringResult::calc_buffer_len(res_len))) { - LOG_WARN("Lob: init failed", K(ret), K(type_), K(res_len)); + } else if (OB_FAIL(ObTextStringResult::calc_buffer_len(res_len))) { + LOG_WARN("Lob: calc buffer len failed", K(ret), K(type_), K(res_len)); } else if (buff_len_ == 0) { OB_ASSERT(has_lob_header_ == false); // empty result without header } else { @@ -61,8 +61,8 @@ int ObTextStringDatumResult::init_with_batch_idx(int64_t res_len, int64_t batch_ if((OB_ISNULL(expr_) || OB_ISNULL(ctx_) || OB_ISNULL(res_datum_))) { ret = OB_INVALID_ARGUMENT; LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KP(expr_), KP(ctx_), KP(res_datum_)); - } else if (FALSE_IT(ObTextStringResult::calc_buffer_len(res_len))) { - LOG_WARN("Lob: init failed", K(ret), K(type_), KP(expr_), KP(ctx_), KP(res_datum_)); + } else if (OB_FAIL(ObTextStringResult::calc_buffer_len(res_len))) { + LOG_WARN("Lob: calc buffer len failed", K(ret), K(type_), KP(expr_), KP(ctx_), KP(res_datum_)); } else { buffer_ = expr_->get_str_res_mem(*ctx_, buff_len_, batch_idx); if (OB_FAIL(fill_temp_lob_header(res_len))) { @@ -89,8 +89,8 @@ int ObTextStringObObjResult::init(int64_t res_len, ObIAllocator *allocator) } else if (OB_ISNULL(res_obj_)) { ret = OB_INVALID_ARGUMENT; LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KP(res_obj_)); - } else if (FALSE_IT(ObTextStringResult::calc_buffer_len(res_len))) { - LOG_WARN("Lob: init failed", K(ret), K(type_), KP(res_len)); + } else if (OB_FAIL(ObTextStringResult::calc_buffer_len(res_len))) { + LOG_WARN("Lob: calc buffer len failed", K(ret), K(type_), KP(res_len)); } else if (buff_len_ == 0) { OB_ASSERT(has_lob_header_ == false); // empty result without header } else {