Merge pull request #8908 from azat/fixes

Tiny fixes
This commit is contained in:
alexey-milovidov 2020-01-31 23:22:30 +03:00 committed by GitHub
commit d20bae03fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View File

@ -1272,8 +1272,8 @@ MarkRanges MergeTreeDataSelectExecutor::filterMarksUsingIndex(
const size_t min_marks_for_seek = roundRowsOrBytesToMarks(
settings.merge_tree_min_rows_for_seek,
settings.merge_tree_min_bytes_for_seek,
part->index_granularity_info.index_granularity_bytes,
part->index_granularity_info.fixed_index_granularity);
part->index_granularity_info.fixed_index_granularity,
part->index_granularity_info.index_granularity_bytes);
size_t granules_dropped = 0;

View File

@ -399,7 +399,7 @@ BlockInputStreams StorageDistributed::read(
if (force)
{
std::stringstream exception_message;
if (has_sharding_key)
if (!has_sharding_key)
exception_message << "No sharding key";
else
exception_message << "Sharding key " << sharding_key_column_name << " is not used";

View File

@ -1,26 +1,26 @@
set optimize_skip_unused_shards=1;
drop table if exists data_01068;
drop table if exists dist_01068;
drop table if exists data_01071;
drop table if exists dist_01071;
create table data_01068 (key Int) Engine=Null();
create table data_01071 (key Int) Engine=Null();
create table dist_01068 as data_01068 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01068);
create table dist_01071 as data_01071 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01071);
set force_optimize_skip_unused_shards=0;
select * from dist_01068;
select * from dist_01071;
set force_optimize_skip_unused_shards=1;
select * from dist_01068;
select * from dist_01071;
set force_optimize_skip_unused_shards=2;
select * from dist_01068; -- { serverError 507 }
select * from dist_01071; -- { serverError 507 }
drop table if exists dist_01068;
create table dist_01068 as data_01068 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01068, key%2);
drop table if exists dist_01071;
create table dist_01071 as data_01071 Engine=Distributed(test_cluster_two_shards, currentDatabase(), data_01071, key%2);
set force_optimize_skip_unused_shards=0;
select * from dist_01068;
select * from dist_01071;
set force_optimize_skip_unused_shards=1;
select * from dist_01068; -- { serverError 507 }
select * from dist_01071; -- { serverError 507 }
set force_optimize_skip_unused_shards=2;
select * from dist_01068; -- { serverError 507 }
select * from dist_01071; -- { serverError 507 }
drop table if exists data_01068;
drop table if exists dist_01068;
drop table if exists data_01071;
drop table if exists dist_01071;