From 629f317d7d836a9563cb9101fff02880af78f0d9 Mon Sep 17 00:00:00 2001 From: Igor Nikonov Date: Thu, 15 Dec 2022 20:01:50 +0000 Subject: [PATCH] Fix for full sorting merge join --- .../QueryPlan/Optimizations/removeRedundantOrderBy.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Processors/QueryPlan/Optimizations/removeRedundantOrderBy.cpp b/src/Processors/QueryPlan/Optimizations/removeRedundantOrderBy.cpp index d5f4b7105d6..d8ddeca636b 100644 --- a/src/Processors/QueryPlan/Optimizations/removeRedundantOrderBy.cpp +++ b/src/Processors/QueryPlan/Optimizations/removeRedundantOrderBy.cpp @@ -1,8 +1,10 @@ #include +#include #include #include #include #include +#include #include #include #include @@ -268,6 +270,12 @@ private: if (typeid_cast(step)) return false; + + if (const auto * join_step = typeid_cast(step); join_step) + { + if (typeid_cast(join_step->getJoin().get())) + return false; + } } return true;