cql3: statement_restrictions: use functional style

Instead of a constructor, use a new function
analyze_statement_restrictions() as the entry point. It returns an
immutable statement_restrictions object.

This opens the door to returning a variant, with each arm of the variant
corresponding to a different query plan.
This commit is contained in:
Avi Kivity
2024-09-17 17:13:27 +03:00
parent 3169b8e0ec
commit 1663fbe717
5 changed files with 43 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ query::clustering_row_ranges slice(
const std::vector<expr::expression>& where_clause, cql_test_env& env,
const sstring& table_name = "t", const sstring& keyspace_name = "ks") {
prepare_context ctx;
return restrictions::statement_restrictions(
return restrictions::analyze_statement_restrictions(
env.data_dictionary(),
env.local_db().find_schema(keyspace_name, table_name),
statements::statement_type::SELECT,