fix defense in check_lock_row_valid for access
This commit is contained in:
@ -1155,8 +1155,7 @@ int ObMultiVersionMicroBlockRowScanner::inner_inner_get_next_row(
|
||||
int64_t rowkey_read_cnt = MIN(read_info_->get_seq_read_column_count(), read_info_->get_rowkey_count());
|
||||
if (OB_FAIL(ObLockRowChecker::check_lock_row_valid(
|
||||
*row,
|
||||
rowkey_read_cnt,
|
||||
false/*is_memtable_iter_row_check*/))) {
|
||||
*read_info_))) {
|
||||
LOG_WARN("micro block reader fail to get block_row", K(ret), K(current_), KPC(row), KPC_(read_info));
|
||||
} else if (row->is_uncommitted_row()) {
|
||||
version_fit = false;
|
||||
@ -1165,6 +1164,7 @@ int ObMultiVersionMicroBlockRowScanner::inner_inner_get_next_row(
|
||||
}
|
||||
if (OB_SUCC(ret) && version_fit) {
|
||||
if (0 != context_->trans_version_range_.base_version_ && is_determined_state) {
|
||||
// major read rows
|
||||
LOG_DEBUG("success to set trans_version on uncommitted row", K(ret), K(trans_version));
|
||||
row->storage_datums_[read_info_->get_schema_rowkey_count()].set_int(-trans_version);
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ int ObLockRowChecker::check_lock_row_valid(
|
||||
if (OB_UNLIKELY(row.get_column_count() < rowkey_cnt)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
STORAGE_LOG(WARN, "row count is less than rowkey count", K(row), K(rowkey_cnt));
|
||||
} else {
|
||||
} else if (row.is_uncommitted_row() || is_memtable_iter_row_check) {
|
||||
bool pure_empty_row = true;
|
||||
for (int i = rowkey_cnt; pure_empty_row && i < row.get_column_count(); ++i) {
|
||||
if (!row.storage_datums_[i].is_nop()) { // not nop value
|
||||
@ -319,5 +319,30 @@ int ObLockRowChecker::check_lock_row_valid(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLockRowChecker::check_lock_row_valid(
|
||||
const blocksstable::ObDatumRow &row,
|
||||
const ObTableReadInfo &read_info)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
int64_t rowkey_read_cnt = MIN(read_info.get_seq_read_column_count(), read_info.get_rowkey_count());
|
||||
if (OB_UNLIKELY(!read_info.is_valid() || row.get_column_count() < rowkey_read_cnt)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid argument", KR(ret), K(read_info), K(row));
|
||||
} else if (row.is_uncommitted_row()) {
|
||||
const common::ObIArray<int32_t> &col_index = read_info.get_columns_index();
|
||||
for (int i = rowkey_read_cnt; i < row.get_column_count(); ++i) {
|
||||
if (col_index.at(i) < read_info.get_rowkey_count()) {
|
||||
// not checking rowkey col
|
||||
} else if (!row.storage_datums_[i].is_nop()) { // not nop value
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
STORAGE_LOG(WARN, "uncommitted lock row have normal cells", K(ret), K(row),
|
||||
K(rowkey_read_cnt), K(read_info));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -319,6 +319,9 @@ public:
|
||||
const blocksstable::ObDatumRow &row,
|
||||
const int64_t rowkey_cnt,
|
||||
bool is_memtable_iter_row_check);
|
||||
static int check_lock_row_valid(
|
||||
const blocksstable::ObDatumRow &row,
|
||||
const ObTableReadInfo &read_info);
|
||||
};
|
||||
|
||||
#define STORE_ITER_ROW_IN_GAP 1
|
||||
|
Reference in New Issue
Block a user