From b6ae72f0950cfce943e10db87caa504e7651cda7 Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Mon, 18 Jul 2022 15:52:24 +0200 Subject: [PATCH] cql3: Remove _nonprimary_key_restrictions field All code that made use of _nonprimary_key_restrictions has been modified to use _new_nonprimary_key_restrictions instead. The field can be removed. Additionally the old code responsible for adding new restrictions can be fully removed, everything is now done using add_restriction. Signed-off-by: Jan Ciolek --- cql3/restrictions/statement_restrictions.cc | 14 -------------- cql3/restrictions/statement_restrictions.hh | 2 -- 2 files changed, 16 deletions(-) diff --git a/cql3/restrictions/statement_restrictions.cc b/cql3/restrictions/statement_restrictions.cc index b0595f5263..72f0e15031 100644 --- a/cql3/restrictions/statement_restrictions.cc +++ b/cql3/restrictions/statement_restrictions.cc @@ -114,7 +114,6 @@ statement_restrictions::initial_key_restrictions::merge_t statement_restrictions::statement_restrictions(schema_ptr schema, bool allow_filtering) : _schema(schema) - , _nonprimary_key_restrictions(::make_shared(schema)) , _partition_range_is_simple(true) { } #if 0 @@ -418,19 +417,6 @@ statement_restrictions::statement_restrictions(data_dictionary::database db, add_restriction(prepared_restriction, schema, allow_filtering, for_view); if (prepared_restriction.op != expr::oper_t::IS_NOT) { - const auto restriction = expr::convert_to_restriction(prepared_restriction, schema); - if (dynamic_pointer_cast(restriction)) { - } else if (has_token(restriction->expression)) { - } else { - auto single = restriction; - auto& def = *get_the_only_column(single->expression).col; - if (def.is_partition_key()) { - } else if (def.is_clustering_key()) { - } else { - _nonprimary_key_restrictions->add_restriction(single); - } - } - _where = _where.has_value() ? make_conjunction(std::move(*_where), prepared_restriction) : prepared_restriction; } } diff --git a/cql3/restrictions/statement_restrictions.hh b/cql3/restrictions/statement_restrictions.hh index 76fa557a47..731e00b2e0 100644 --- a/cql3/restrictions/statement_restrictions.hh +++ b/cql3/restrictions/statement_restrictions.hh @@ -57,8 +57,6 @@ private: /** * Restriction on non-primary key columns (i.e. secondary index restrictions) */ - ::shared_ptr _nonprimary_key_restrictions; - expr::expression _new_nonprimary_key_restrictions; expr::single_column_restrictions_map _single_column_nonprimary_key_restrictions;