[BUGFIX] fix append lob null data

This commit is contained in:
obdev
2023-02-07 14:14:08 +08:00
committed by ob-robot
parent 92e68b0868
commit be78b2f3d8
2 changed files with 11 additions and 6 deletions

View File

@ -127,7 +127,9 @@ int ObInsertLobColumnHelper::insert_lob_column(ObIAllocator &allocator,
LOG_WARN("fail to get snapshot", K(ret));
} else {
ObString data = datum.get_string();
ObLobLocatorV2 src(data, has_lob_header);
// 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);
// 4.0 text tc compatiable
ObLobAccessParam lob_param;
lob_param.tx_desc_ = tx_desc;

View File

@ -4987,6 +4987,7 @@ int ObLSTabletService::process_old_row_lob_col(
if (has_lob_header) {
obj.set_has_lob_header();
}
run_ctx.is_old_row_valid_for_lob_ = true;
}
}
}
@ -5190,11 +5191,13 @@ int ObLSTabletService::delete_lob_tablet_rows(
ObLobCommon *lob_common = nullptr;
for (int64_t i = 0; OB_SUCC(ret) && i < col_cnt; ++i) {
const ObColDesc &column = run_ctx.col_descs_->at(i);
ObObj &obj = tbl_row.row_val_.get_cell(i);
const ObObj &sql_obj = row.get_cell(i);
ObLobAccessParam lob_param;
if (OB_FAIL(delete_lob_col(run_ctx, column, obj, sql_obj, lob_common, lob_param))) {
LOG_WARN("[STORAGE_LOB]failed to erase lob col.", K(ret), K(i), K(tbl_row));
if (column.col_type_.is_lob_storage()) {
ObObj &obj = tbl_row.row_val_.get_cell(i);
const ObObj &sql_obj = row.get_cell(i);
ObLobAccessParam lob_param;
if (OB_FAIL(delete_lob_col(run_ctx, column, obj, sql_obj, lob_common, lob_param))) {
LOG_WARN("[STORAGE_LOB]failed to erase lob col.", K(ret), K(i), K(tbl_row));
}
}
}
}