cql3: Move strict_allow_filtering to cql_config
The strict_allow_filtering option controls whether queries that require ALLOW FILTERING are silently accepted, warned about, or rejected. It belongs in cql_config rather than db::config as it directly governs CQL query behavior at prepare time. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "restrictions/restrictions_config.hh"
|
||||
#include "db/tri_mode_restriction.hh"
|
||||
#include "utils/updateable_value.hh"
|
||||
|
||||
namespace db { class config; }
|
||||
@@ -20,15 +21,18 @@ namespace cql3 {
|
||||
struct cql_config {
|
||||
restrictions::restrictions_config restrictions;
|
||||
utils::updateable_value<uint32_t> select_internal_page_size;
|
||||
utils::updateable_value<db::tri_mode_restriction> strict_allow_filtering;
|
||||
|
||||
explicit cql_config(const db::config& cfg)
|
||||
: restrictions(cfg)
|
||||
, select_internal_page_size(cfg.select_internal_page_size)
|
||||
, strict_allow_filtering(cfg.strict_allow_filtering)
|
||||
{}
|
||||
struct default_tag{};
|
||||
cql_config(default_tag)
|
||||
: restrictions(restrictions::restrictions_config::default_tag{})
|
||||
, select_internal_page_size(10000)
|
||||
, strict_allow_filtering(db::tri_mode_restriction(db::tri_mode_restriction_t::mode::WARN))
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
@@ -2424,7 +2424,7 @@ std::unique_ptr<prepared_statement> select_statement::prepare(data_dictionary::d
|
||||
|
||||
std::vector<sstring> warnings;
|
||||
if (!is_ann_query) {
|
||||
check_needs_filtering(*restrictions, db.get_config().strict_allow_filtering(), warnings);
|
||||
check_needs_filtering(*restrictions, cfg.strict_allow_filtering(), warnings);
|
||||
ensure_filtering_columns_retrieval(db, *selection, *restrictions);
|
||||
}
|
||||
auto group_by_cell_indices = ::make_shared<std::vector<size_t>>(prepare_group_by(*schema, *selection));
|
||||
|
||||
Reference in New Issue
Block a user