cql3: add specified is_satisfied_by to multi-column restriction

Multi-column restrictions need only schema, clustering key and query
options in order to decide if they are satisfied, so an overloaded
function that takes reduced number of parameters is added.
This commit is contained in:
Piotr Sarna
2019-02-19 13:15:41 +01:00
parent 16dbc917a4
commit 3db526ffe2

View File

@@ -101,6 +101,10 @@ public:
const row& cells,
const query_options& options,
gc_clock::time_point now) const override {
return is_satisfied_by(schema, ckey, options);
}
bool is_satisfied_by(const schema& schema, const clustering_key_prefix& ckey, const query_options& options) const {
return boost::algorithm::any_of(bounds_ranges(options), [&ckey, &schema] (const bounds_range_type& range) {
return range.contains(query::clustering_range(ckey), clustering_key_prefix::prefix_equal_tri_compare(schema));
});