[BUGFIX]fix repeat over 512M return error
This commit is contained in:
@ -990,8 +990,9 @@ int ObTextStringIter::convert_outrow_lob_to_inrow_templob(const ObObj &in_obj,
|
|||||||
|
|
||||||
// ----- implementations of ObTextStringResult -----
|
// ----- 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
|
if (!(is_lob_storage(type_))) { // tinytext no has lob header
|
||||||
buff_len_ = res_len;
|
buff_len_ = res_len;
|
||||||
} else {
|
} else {
|
||||||
@ -1004,10 +1005,12 @@ void ObTextStringResult::calc_buffer_len(int64_t res_len)
|
|||||||
res_len += sizeof(ObLobCommon);
|
res_len += sizeof(ObLobCommon);
|
||||||
buff_len_ = ObLobLocatorV2::calc_locator_full_len(extern_flags, 0, static_cast<uint32_t>(res_len), false);
|
buff_len_ = ObLobLocatorV2::calc_locator_full_len(extern_flags, 0, static_cast<uint32_t>(res_len), false);
|
||||||
} else {
|
} else {
|
||||||
LOG_WARN_RET(OB_NOT_IMPLEMENT, "Lob: out row temp lob not implemented",
|
ret = OB_SIZE_OVERFLOW;
|
||||||
K(OB_NOT_IMPLEMENT), K(this), K(pos_), K(buff_len_));
|
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)
|
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_))) {
|
} else if (!(ob_is_string_or_lob_type(type_) || ob_is_json(type_))) {
|
||||||
ret = OB_ERR_UNEXPECTED;
|
ret = OB_ERR_UNEXPECTED;
|
||||||
LOG_WARN("Lob: unexpected expr result type for textstring result", K(ret), K(type_));
|
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) {
|
} else if (buff_len_ == 0) {
|
||||||
OB_ASSERT(has_lob_header_ == false); // empty result without header
|
OB_ASSERT(has_lob_header_ == false); // empty result without header
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -267,7 +267,7 @@ public:
|
|||||||
ObIAllocator &allocator);
|
ObIAllocator &allocator);
|
||||||
|
|
||||||
protected:
|
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);
|
int fill_temp_lob_header(const int64_t res_len);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -35,8 +35,8 @@ int ObTextStringDatumResult::init(int64_t res_len, ObIAllocator *allocator)
|
|||||||
} else if((OB_ISNULL(res_datum_))) {
|
} else if((OB_ISNULL(res_datum_))) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KPC(res_datum_));
|
LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KPC(res_datum_));
|
||||||
} else if (FALSE_IT(ObTextStringResult::calc_buffer_len(res_len))) {
|
} else if (OB_FAIL(ObTextStringResult::calc_buffer_len(res_len))) {
|
||||||
LOG_WARN("Lob: init failed", K(ret), K(type_), K(res_len));
|
LOG_WARN("Lob: calc buffer len failed", K(ret), K(type_), K(res_len));
|
||||||
} else if (buff_len_ == 0) {
|
} else if (buff_len_ == 0) {
|
||||||
OB_ASSERT(has_lob_header_ == false); // empty result without header
|
OB_ASSERT(has_lob_header_ == false); // empty result without header
|
||||||
} else {
|
} 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_))) {
|
if((OB_ISNULL(expr_) || OB_ISNULL(ctx_) || OB_ISNULL(res_datum_))) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KP(expr_), KP(ctx_), KP(res_datum_));
|
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))) {
|
} else if (OB_FAIL(ObTextStringResult::calc_buffer_len(res_len))) {
|
||||||
LOG_WARN("Lob: init failed", K(ret), K(type_), KP(expr_), KP(ctx_), KP(res_datum_));
|
LOG_WARN("Lob: calc buffer len failed", K(ret), K(type_), KP(expr_), KP(ctx_), KP(res_datum_));
|
||||||
} else {
|
} else {
|
||||||
buffer_ = expr_->get_str_res_mem(*ctx_, buff_len_, batch_idx);
|
buffer_ = expr_->get_str_res_mem(*ctx_, buff_len_, batch_idx);
|
||||||
if (OB_FAIL(fill_temp_lob_header(res_len))) {
|
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_)) {
|
} else if (OB_ISNULL(res_obj_)) {
|
||||||
ret = OB_INVALID_ARGUMENT;
|
ret = OB_INVALID_ARGUMENT;
|
||||||
LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KP(res_obj_));
|
LOG_WARN("Lob: invalid arguments", K(ret), K(type_), KP(res_obj_));
|
||||||
} else if (FALSE_IT(ObTextStringResult::calc_buffer_len(res_len))) {
|
} else if (OB_FAIL(ObTextStringResult::calc_buffer_len(res_len))) {
|
||||||
LOG_WARN("Lob: init failed", K(ret), K(type_), KP(res_len));
|
LOG_WARN("Lob: calc buffer len failed", K(ret), K(type_), KP(res_len));
|
||||||
} else if (buff_len_ == 0) {
|
} else if (buff_len_ == 0) {
|
||||||
OB_ASSERT(has_lob_header_ == false); // empty result without header
|
OB_ASSERT(has_lob_header_ == false); // empty result without header
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user