mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
CLICKHOUSE-2211: Add exception for impossible case
This commit is contained in:
parent
fe6406eac1
commit
87bb06fdd8
@ -9,6 +9,11 @@ namespace ProfileEvents
|
||||
extern const Event ReadBackoff;
|
||||
}
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
@ -133,6 +138,10 @@ MarkRanges MergeTreeReadPool::getRestMarks(const std::string & part_path, const
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (all_part_ranges.empty())
|
||||
throw Exception("Trying to read marks range [" + std::to_string(from.begin) + ", " + std::to_string(from.end) + "] from part '"
|
||||
+ part_path + "' which has no ranges in this query", ErrorCodes::LOGICAL_ERROR);
|
||||
|
||||
auto begin = std::lower_bound(all_part_ranges.begin(), all_part_ranges.end(), from, [] (const auto & f, const auto & s) { return f.begin < s.begin; });
|
||||
if (begin == all_part_ranges.end())
|
||||
begin = std::prev(all_part_ranges.end());
|
||||
|
Loading…
Reference in New Issue
Block a user