From a827462f55f17e7eae0b069a9b40c9060cdc3d67 Mon Sep 17 00:00:00 2001 From: feng lv Date: Sun, 2 Aug 2020 20:30:41 +0800 Subject: [PATCH] fix --- src/Interpreters/InterpreterInsertQuery.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Interpreters/InterpreterInsertQuery.cpp b/src/Interpreters/InterpreterInsertQuery.cpp index 6cd706b4eb9..40549fca4b1 100644 --- a/src/Interpreters/InterpreterInsertQuery.cpp +++ b/src/Interpreters/InterpreterInsertQuery.cpp @@ -204,7 +204,7 @@ BlockIO InterpreterInsertQuery::execute() auto optimize_trivial_insert_select = settings.optimize_trivial_insert_select; if (optimize_trivial_insert_select) { - auto is_trivial_select = [](const auto query_) + auto is_trivial_select = [](const auto && query_) { if (query_.tables()) { @@ -219,10 +219,8 @@ BlockIO InterpreterInsertQuery::execute() } } } - if (!query_.distinct && !query_.limit_with_ties && !query_.prewhere() && !query_.where() && !query_.groupBy() - && !query_.having() && !query_.orderBy() && !query_.limitBy()) - return true; - return false; + return (!query_.distinct && !query_.limit_with_ties && !query_.prewhere() && !query_.where() && !query_.groupBy() + && !query_.having() && !query_.orderBy() && !query_.limitBy()); }; const auto & ast = query.select->as(); @@ -231,7 +229,7 @@ BlockIO InterpreterInsertQuery::execute() for (size_t query_num = 0; query_num < num_selects; ++query_num) { const auto & query_select = ast.list_of_selects->children.at(query_num)->as(); - if (!is_trivial_select(query_select)) + if (!is_trivial_select(std::move(query_select))) { is_trivial_query = false; break;