Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: hillium <[email protected]>
  • Loading branch information
YuJuncen committed Jul 25, 2023
1 parent 9cad5cc commit 335cdba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions db/compaction/compaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,11 @@ std::vector<SstPartitioner::Segment> Compaction::CreateSegmentsForLevel(
// makes sense for not supporting L0.
assert(in_level != 0);

// Some of test cases may not initialize the version...
if (input_version_ == nullptr) {
return std::vector<SstPartitioner::Segment>();
}

const auto vsi = input_version_->storage_info();
if (in_level >= vsi->num_non_empty_levels()) {
// The level shall be empty.
Expand Down

0 comments on commit 335cdba

Please sign in to comment.