diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index 299f35d1d7..9088ef6c84 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -1216,12 +1216,14 @@ storage_proxy::query_local(const sstring& ks_name, const sstring& cf_name, const std::vector row_ranges = {query::clustering_range::make_open_ended_both_sides()}; std::vector regular_cols; boost::range::push_back(regular_cols, schema->regular_columns() | boost::adaptors::transformed([] (auto&& col) { return col.id; })); + std::vector static_cols; + boost::range::push_back(static_cols, schema->static_columns() | boost::adaptors::transformed([] (auto&& col) { return col.id; })); auto opts = query::partition_slice::option_set::of< - query::partition_slice::option::send_partition_key>(); - query::partition_slice slice{row_ranges, {}, regular_cols, opts}; + query::partition_slice::option::send_partition_key, + query::partition_slice::option::send_clustering_key>(); + query::partition_slice slice{row_ranges, static_cols, regular_cols, opts}; std::vector pr = {query::partition_range::make_open_ended_both_sides()}; - auto id = db.find_uuid(ks_name, cf_name); - auto cmd = make_lw_shared(id, pr, slice, std::numeric_limits::max()); + auto cmd = make_lw_shared(schema->id(), pr, slice, std::numeric_limits::max()); return db.query(*cmd).then([key, schema, slice](lw_shared_ptr&& result) { query::result_set_builder builder{schema}; bytes_ostream w(result->buf());