This commit is contained in:
Nikita Vasilev 2019-01-07 22:21:51 +03:00
parent 69c6e77d53
commit 76c25c2024
2 changed files with 10 additions and 6 deletions

View File

@ -536,11 +536,9 @@ namespace DB
/// Maybe it should be moved to BlockInputStream, but it can cause some problems.
for (auto index : data.indexes) {
auto condition = index->createIndexCondition(query_info, context);
if (condition->alwaysUnknownOrTrue()) {
continue;
if (!condition->alwaysUnknownOrTrue()) {
ranges.ranges = filterMarksUsingIndex(index, condition, part, ranges.ranges, settings);
}
ranges.ranges = filterMarksUsingIndex(index, condition, part, ranges.ranges, settings);
}
if (!ranges.ranges.empty())
@ -983,7 +981,8 @@ namespace DB
for (const auto & range : ranges)
{
MarkRange index_range(
range.begin / index->granularity, range.end / index->granularity);
range.begin / index->granularity,
(range.end + index->granularity - 1) / index->granularity);
if (last_index_mark != index_range.begin || !granule) {
reader.seek(index_range.begin);

View File

@ -7,6 +7,9 @@
#include <IO/WriteHelpers.h>
#include <IO/ReadHelpers.h>
#include <iostream>
#include <random>
namespace DB {
class MergeTreeTestIndex;
@ -15,11 +18,13 @@ struct MergeTreeTestGranule : public MergeTreeIndexGranule {
~MergeTreeTestGranule() override {};
void serializeBinary(WriteBuffer &ostr) const override {
//std::cerr << "TESTINDEX: written " << emp << "\n";
writeIntBinary(emp, ostr);
}
void deserializeBinary(ReadBuffer &istr) override {
readIntBinary(emp, istr);
//std::cerr << "TESTINDEX: read " << emp << "\n";
}
bool empty() const override {
@ -28,7 +33,7 @@ struct MergeTreeTestGranule : public MergeTreeIndexGranule {
void update(const Block &block, size_t *pos, size_t limit) override {
*pos += std::min(limit, block.rows() - *pos);
emp = false;
emp = rand();
};
Int32 emp = true;