dbms: fixed error with 'max_distributed_connections = 1' [#METR-14855].

This commit is contained in:
Alexey Milovidov 2015-02-01 11:02:18 +03:00
parent a65acf8a03
commit ee98a3babc
3 changed files with 4 additions and 5 deletions

View File

@ -454,13 +454,13 @@ void InterpreterSelectQuery::executeSingleQuery()
settings.limits.max_rows_to_group_by &&
settings.limits.group_by_overflow_mode == OverflowMode::ANY &&
settings.totals_mode != TotalsMode::AFTER_HAVING_EXCLUSIVE;
/// Нужно ли после агрегации сразу финализировать агрегатные функции.
bool aggregate_final =
need_aggregate &&
to_stage > QueryProcessingStage::WithMergeableState &&
!query.group_by_with_totals;
if (need_aggregate || has_order_by)
do_execute_union = true;
@ -769,10 +769,6 @@ void InterpreterSelectQuery::executeAggregation(BlockInputStreams & streams, Exp
void InterpreterSelectQuery::executeMergeAggregated(BlockInputStreams & streams, bool overflow_row, bool final)
{
/// Если объединять нечего
if (streams.size() == 1)
return;
/// Склеим несколько источников в один
executeUnion(streams);

View File

@ -0,0 +1,2 @@
SET max_distributed_connections = 1;
SELECT count() + 1 FROM remote('127.0.0.{1,2}', system, one);