Merge branch 'ISSUES-2581' of github.com:VadimPE/ClickHouse into ISSUES-2581

This commit is contained in:
VadimPE 2018-08-14 13:25:15 +03:00
commit 74aded610f

View File

@ -338,7 +338,7 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts(
if (relative_sample_size == RelativeSize(1))
relative_sample_size = 0;
if (relative_sample_offset > 0 && 0 == relative_sample_size)
if (relative_sample_offset > 0 && RelativeSize(0) == relative_sample_size)
throw Exception("Sampling offset is incorrect because no sampling", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
if (relative_sample_offset > 1)
@ -389,7 +389,7 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts(
if (!data.sampling_expression)
throw Exception("Illegal SAMPLE: table doesn't support sampling", ErrorCodes::SAMPLING_NOT_SUPPORTED);
if (sample_factor_column_queried && relative_sample_size != 0)
if (sample_factor_column_queried && relative_sample_size != RelativeSize(0))
used_sample_factor = 1.0 / boost::rational_cast<Float64>(relative_sample_size);
RelativeSize size_of_universum = 0;