Skip to content

Commit

Permalink
BugFix: add nullptr check for allocate_rows() (#267)
Browse files Browse the repository at this point in the history
return zero when _swap_row_block is nullptr
  • Loading branch information
sevev authored Sep 16, 2021
1 parent 136deff commit 98568af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/storage/schema_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class RowBlockSorter {
virtual ~RowBlockSorter();

bool sort(RowBlock** row_block);
size_t allocated_rows() { return _swap_row_block->capacity(); }
size_t allocated_rows() { return (_swap_row_block == nullptr) ? 0 : _swap_row_block->capacity(); }

private:
static bool _row_cursor_comparator(const RowCursor* a, const RowCursor* b) { return compare_row(*a, *b) < 0; }
Expand Down

0 comments on commit 98568af

Please sign in to comment.