diff --git a/cql3/restrictions/statement_restrictions.cc b/cql3/restrictions/statement_restrictions.cc index 6751f7fc8f..07aa8a527e 100644 --- a/cql3/restrictions/statement_restrictions.cc +++ b/cql3/restrictions/statement_restrictions.cc @@ -2718,13 +2718,14 @@ statement_restrictions::build_get_clustering_bounds_fn() const { }; } if (find_binop(_clustering_prefix_restrictions[0].filter, is_multi_column)) { // FIXME: adjust for solve_for - return [&] (const query_options& options) -> std::vector { bool all_natural = true, all_reverse = true; ///< Whether column types are reversed or natural. for (auto& r : _clustering_prefix_restrictions | std::views::transform(&predicate::filter)) { // TODO: move to constructor, do only once. using namespace expr; const auto& binop = expr::as(r); if (is_clustering_order(binop)) { + return [this] (const query_options& options) -> std::vector { return {range_from_raw_bounds(_clustering_prefix_restrictions, options, *_schema)}; + }; } for (auto& element : expr::as(binop.lhs).elements) { auto& cv = expr::as(element); @@ -2735,6 +2736,7 @@ statement_restrictions::build_get_clustering_bounds_fn() const { } } } + return [this, all_natural, all_reverse] (const query_options& options) -> std::vector { return get_multi_column_clustering_bounds(options, _schema, _clustering_prefix_restrictions, all_natural, all_reverse); };