bugfix inc direct_load inrow check incorrect

This commit is contained in:
shadowao
2024-05-28 11:30:59 +00:00
committed by ob-robot
parent d19563a1ae
commit 48ff369f14
2 changed files with 10 additions and 4 deletions

View File

@ -508,7 +508,7 @@ static int check_lob_is_inrow(const ObObj &obj, const int64_t lob_inrow_threshol
int ret = OB_SUCCESS;
is_inrow = false;
ObLobManager *lob_mngr = MTL(ObLobManager*);
if (OB_UNLIKELY(!obj.is_lob_storage() || lob_inrow_threshold <= 0)) {
if (OB_UNLIKELY(!obj.is_lob_storage() || lob_inrow_threshold < 0)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid args", KR(ret), K(obj), K(lob_inrow_threshold));
} else if (OB_ISNULL(lob_mngr)) {
@ -518,7 +518,10 @@ static int check_lob_is_inrow(const ObObj &obj, const int64_t lob_inrow_threshol
ObString data = obj.get_string();
const bool set_has_lob_header = data.length() > 0;
ObLobLocatorV2 src(data, set_has_lob_header);
if (src.has_inrow_data() && lob_mngr->can_write_inrow(data.length(), lob_inrow_threshold)) {
int64_t byte_len = 0;
if (OB_FAIL(src.get_lob_data_byte_len(byte_len))) {
LOG_WARN("fail to get lob data byte len", K(ret), K(src));
} else if (src.has_inrow_data() && lob_mngr->can_write_inrow(byte_len, lob_inrow_threshold)) {
is_inrow = true;
} else {
is_inrow = false;

View File

@ -205,7 +205,10 @@ int ObInsertLobColumnHelper::insert_lob_column(ObIAllocator &allocator,
// datum with null ptr and zero len should treat as no lob header
bool set_has_lob_header = has_lob_header && data.length() > 0;
ObLobLocatorV2 src(data, set_has_lob_header);
if (src.has_inrow_data() && lob_mngr->can_write_inrow(data.length(), lob_storage_param.inrow_threshold_)) {
int64_t byte_len = 0;
if (OB_FAIL(src.get_lob_data_byte_len(byte_len))) {
LOG_WARN("fail to get lob data byte len", K(ret), K(src));
} else if (src.has_inrow_data() && lob_mngr->can_write_inrow(byte_len, lob_storage_param.inrow_threshold_)) {
// fast path for inrow data
if (OB_FAIL(src.get_inrow_data(data))) {
LOG_WARN("fail to get inrow data", K(ret), K(src));
@ -307,7 +310,7 @@ int ObInsertLobColumnHelper::insert_lob_column(ObIAllocator &allocator,
int64_t byte_len = 0;
if (OB_FAIL(src.get_lob_data_byte_len(byte_len))) {
LOG_WARN("fail to get lob data byte len", K(ret), K(src));
} else if (src.has_inrow_data() && lob_mngr->can_write_inrow(data.length(), lob_storage_param.inrow_threshold_)) {
} else if (src.has_inrow_data() && lob_mngr->can_write_inrow(byte_len, lob_storage_param.inrow_threshold_)) {
// do fast inrow
if (OB_FAIL(src.get_inrow_data(data))) {
LOG_WARN("fail to get inrow data", K(ret), K(src));