Skip to content

Commit 772044e

Browse files
branch-4.0: [Exec](topn) prevent coredump if row store not match in schema change #59980 (#59992)
Cherry-picked from #59980 Co-authored-by: HappenLee <happenlee@selectdb.com>
1 parent 07463a8 commit 772044e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

be/src/exec/rowid_fetcher.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,10 @@ Status RowIdStorageReader::read_by_rowids(const PMultiGetRequest& request,
451451
cast_set<uint32_t>(row_loc.ordinal_id()));
452452
// fetch by row store, more effcient way
453453
if (request.fetch_row_store()) {
454-
CHECK(tablet->tablet_schema()->has_row_store_for_all_columns());
454+
if (!tablet->tablet_schema()->has_row_store_for_all_columns()) {
455+
return Status::InternalError("Tablet {} does not have row store for all columns",
456+
tablet->tablet_id());
457+
}
455458
RowLocation loc(rowset_id, segment->id(), cast_set<uint32_t>(row_loc.ordinal_id()));
456459
std::string* value = response->add_binary_row_data();
457460
RETURN_IF_ERROR(scope_timer_run(
@@ -1094,7 +1097,10 @@ Status RowIdStorageReader::read_doris_format_row(
10941097

10951098
// if row_store_read_struct not empty, means the line we should read from row_store
10961099
if (!row_store_read_struct.default_values.empty()) {
1097-
CHECK(tablet->tablet_schema()->has_row_store_for_all_columns());
1100+
if (!tablet->tablet_schema()->has_row_store_for_all_columns()) {
1101+
return Status::InternalError("Tablet {} does not have row store for all columns",
1102+
tablet->tablet_id());
1103+
}
10981104
for (auto row_id : row_ids) {
10991105
RowLocation loc(rowset_id, segment->id(), cast_set<uint32_t>(row_id));
11001106
row_store_read_struct.row_store_buffer.clear();

0 commit comments

Comments
 (0)