From c8d4952702d4a4a75d6bdbd7d1462cfea9b2f87b Mon Sep 17 00:00:00 2001 From: Anastasiya Rodigina Date: Sat, 18 May 2019 21:13:18 +0300 Subject: [PATCH] Fix test with order by and final, need to think about it --- dbms/src/Interpreters/InterpreterSelectQuery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Interpreters/InterpreterSelectQuery.cpp b/dbms/src/Interpreters/InterpreterSelectQuery.cpp index 55df3e1a3ad..f39206f56bc 100644 --- a/dbms/src/Interpreters/InterpreterSelectQuery.cpp +++ b/dbms/src/Interpreters/InterpreterSelectQuery.cpp @@ -1511,7 +1511,7 @@ void InterpreterSelectQuery::executeOrder(Pipeline & pipeline, SelectQueryInfo & settings.max_bytes_before_external_sort, context.getTemporaryPath()); }; - if (settings.optimize_pk_order && !query.groupBy() && !order_descr.empty()) + if (settings.optimize_pk_order && !query.groupBy() && !order_descr.empty() && !query.final()) { if (const auto * merge_tree = dynamic_cast(storage.get())) {