Fix test with order by and final, need to think about it

This commit is contained in:
Anastasiya Rodigina 2019-05-18 21:13:18 +03:00
parent b3d811a199
commit c8d4952702

View File

@ -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<const MergeTreeData *>(storage.get()))
{