diff --git a/cql3/restrictions/statement_restrictions.cc b/cql3/restrictions/statement_restrictions.cc index c2c44b6ca3..d1a4a6b0ce 100644 --- a/cql3/restrictions/statement_restrictions.cc +++ b/cql3/restrictions/statement_restrictions.cc @@ -470,6 +470,9 @@ statement_restrictions::statement_restrictions(data_dictionary::database db, } } if (_where.has_value()) { + if (!has_token(_new_partition_key_restrictions)) { + _single_column_partition_key_restrictions = expr::get_single_column_restrictions_map(_new_partition_key_restrictions); + } _clustering_prefix_restrictions = extract_clustering_prefix_restrictions(*_where, _schema); _partition_range_restrictions = extract_partition_range(*_where, _schema); } diff --git a/cql3/restrictions/statement_restrictions.hh b/cql3/restrictions/statement_restrictions.hh index 2e70f89a1b..26f91670e7 100644 --- a/cql3/restrictions/statement_restrictions.hh +++ b/cql3/restrictions/statement_restrictions.hh @@ -46,6 +46,8 @@ private: expr::expression _new_partition_key_restrictions; + expr::single_column_restrictions_map _single_column_partition_key_restrictions; + /** * Restrictions on clustering columns */