Skip to content

Commit

Permalink
[bugfix](topn) fix coredump in copy_column_data_to_block when nullabl…
Browse files Browse the repository at this point in the history
…e mismatch

return RuntimeError if copy_column_data_to_block nullable mismatch to avoid coredump in input_col_ptr->filter_by_selector(sel_rowid_idx, select_size, raw_res_ptr) .

The problem is reported by a doris user but I can not reproduce it, so there is no testcase added currently.
  • Loading branch information
xiaokang authored and gnehil committed Dec 4, 2023
1 parent f6b3d2e commit e2a090a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions be/src/vec/core/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ class Block {
reinterpret_cast<vectorized::ColumnNullable*>(raw_res_ptr.get());
col_ptr_nullable->get_null_map_column().insert_many_defaults(select_size);
raw_res_ptr = col_ptr_nullable->get_nested_column_ptr();
} else if (!raw_res_ptr->is_nullable() && input_col_ptr->is_nullable()) {
LOG(WARNING) << "nullable mismatch for raw_res_column: "
<< this->get_by_position(block_cid).dump_structure()
<< " input_column: " << input_col_ptr->dump_structure()
<< " block_cid: " << block_cid << " select_size: " << select_size;
return Status::RuntimeError("copy_column_data_to_block nullable mismatch");
}

return input_col_ptr->filter_by_selector(sel_rowid_idx, select_size, raw_res_ptr);
Expand Down

0 comments on commit e2a090a

Please sign in to comment.