From 4aa0a03b7ea34a686255a79b28fe85106d12e7cf Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 21 Jul 2022 19:45:04 +0300 Subject: [PATCH] cql3: select_statement: remove wrong but harmless std::move() in prepare_restrictions std::move(_where_clause) is wrong, because _where_clause is used later (when analyzing GROUP BY), but also harmless (because the statement_restrictions constructor accepts it by const reference). To avoid confusion in the next patch where we'll pass _where_clause to a different function, remove the bad std::move() in advance here. --- cql3/statements/select_statement.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cql3/statements/select_statement.cc b/cql3/statements/select_statement.cc index 5feedcdfd2..3f13cb480b 100644 --- a/cql3/statements/select_statement.cc +++ b/cql3/statements/select_statement.cc @@ -1719,7 +1719,7 @@ select_statement::prepare_restrictions(data_dictionary::database db, bool allow_filtering) { try { - return ::make_shared(db, schema, statement_type::SELECT, std::move(_where_clause), ctx, + return ::make_shared(db, schema, statement_type::SELECT, _where_clause, ctx, selection->contains_only_static_columns(), for_view, allow_filtering); } catch (const exceptions::unrecognized_entity_exception& e) { if (contains_alias(e.entity)) {