[BUGFIX] fix repeat update lob in one stmt wrong
This commit is contained in:
47
deps/oblib/src/common/object/ob_object.cpp
vendored
47
deps/oblib/src/common/object/ob_object.cpp
vendored
@ -299,6 +299,13 @@ DEF_TO_STRING(ObLobLocatorV2)
|
||||
J_KV(K(*location_info));
|
||||
J_COMMA();
|
||||
}
|
||||
if (buf_len > pos && extern_header->flags_.has_retry_info_
|
||||
&& size_ >= offset + MEM_LOB_EXTERN_RETRYINFO_LEN) {
|
||||
ObMemLobRetryInfo *retry_info = reinterpret_cast<ObMemLobRetryInfo *>(ptr_ + offset);
|
||||
offset += MEM_LOB_EXTERN_RETRYINFO_LEN;
|
||||
J_KV(K(*retry_info));
|
||||
J_COMMA();
|
||||
}
|
||||
if (buf_len > pos) {
|
||||
ObString rowkey_str(MIN(extern_header->rowkey_size_, buf_len - pos), ptr_ + offset);
|
||||
offset += extern_header->rowkey_size_;
|
||||
@ -346,6 +353,9 @@ uint32_t ObLobLocatorV2::calc_locator_full_len(const ObMemLobExternFlags &flags,
|
||||
if (flags.has_location_info_) {
|
||||
loc_len += MEM_LOB_EXTERN_LOCATIONINFO_LEN;
|
||||
}
|
||||
if (flags.has_retry_info_) {
|
||||
loc_len += MEM_LOB_EXTERN_RETRYINFO_LEN;
|
||||
}
|
||||
loc_len += MEM_LOB_ADDR_LEN; //ToDo:@gehao server address.
|
||||
loc_len += rowkey_size;
|
||||
}
|
||||
@ -426,6 +436,10 @@ int ObLobLocatorV2::fill(ObMemLobType type,
|
||||
offset += MEM_LOB_EXTERN_LOCATIONINFO_LEN;
|
||||
*extern_len += MEM_LOB_EXTERN_LOCATIONINFO_LEN;
|
||||
}
|
||||
if (flags.has_retry_info_) {
|
||||
offset += MEM_LOB_EXTERN_RETRYINFO_LEN;
|
||||
*extern_len += MEM_LOB_EXTERN_RETRYINFO_LEN;
|
||||
}
|
||||
|
||||
if ((offset + rowkey_str.length()) && OB_UNLIKELY(offset > size_)) {
|
||||
ret = OB_BUF_NOT_ENOUGH;
|
||||
@ -749,6 +763,28 @@ int ObLobLocatorV2::get_location_info(ObMemLobLocationInfo *&location_info) cons
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLobLocatorV2::get_retry_info(ObMemLobRetryInfo *&retry_info) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObMemLobExternHeader *extern_header = NULL;
|
||||
if (OB_SUCC(get_extern_header(extern_header))) {
|
||||
char *cur_pos = extern_header->data_ + MEM_LOB_EXTERN_SIZE_LEN;
|
||||
if (extern_header->flags_.has_tx_info_) {
|
||||
cur_pos += MEM_LOB_EXTERN_TXINFO_LEN;
|
||||
}
|
||||
if (extern_header->flags_.has_location_info_) {
|
||||
cur_pos += MEM_LOB_EXTERN_LOCATIONINFO_LEN;
|
||||
}
|
||||
if (extern_header->flags_.has_retry_info_) {
|
||||
retry_info = reinterpret_cast<ObMemLobRetryInfo *>(cur_pos);
|
||||
} else {
|
||||
ret = OB_ERR_NULL_VALUE;
|
||||
COMMON_LOG(WARN, "Lob: does not have retry info", K(this), K(ret));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLobLocatorV2::get_real_locator_len(int64_t &real_len) const
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
@ -883,6 +919,17 @@ int ObLobLocatorV2::set_location_info(const ObMemLobLocationInfo &location_info)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLobLocatorV2::set_retry_info(const ObMemLobRetryInfo &retry_info)
|
||||
{
|
||||
validate_has_lob_header(has_lob_header_);
|
||||
int ret = OB_SUCCESS;
|
||||
ObMemLobRetryInfo *retry_info_ptr = NULL;
|
||||
if (OB_SUCC(get_retry_info(retry_info_ptr))) {
|
||||
*retry_info_ptr = retry_info;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
OB_DEF_SERIALIZE(ObLobLocatorV2)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user