diff --git a/db/view/view.cc b/db/view/view.cc index b9525c70fd..8420b382e2 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -1439,6 +1439,7 @@ future view_update_builder::on_results() { } view_update_builder make_view_update_builder( + data_dictionary::database db, const replica::table& base_table, const schema_ptr& base, std::vector&& views_to_update, @@ -1454,7 +1455,7 @@ view_update_builder make_view_update_builder( bool is_index = base_table.get_index_manager().is_index(v.view); return view_updates(std::move(v), is_index); })); - return view_update_builder(base_table, base, std::move(vs), std::move(updates), std::move(existings), now); + return view_update_builder(std::move(db), base_table, base, std::move(vs), std::move(updates), std::move(existings), now); } future calculate_affected_clustering_ranges(const schema& base, diff --git a/db/view/view.hh b/db/view/view.hh index a80e117102..691b386085 100644 --- a/db/view/view.hh +++ b/db/view/view.hh @@ -14,6 +14,7 @@ #include "schema/schema_fwd.hh" #include "readers/flat_mutation_reader_v2.hh" #include "mutation/frozen_mutation.hh" +#include "data_dictionary/data_dictionary.hh" class frozen_mutation_and_schema; @@ -244,6 +245,7 @@ private: }; class view_update_builder { + data_dictionary::database _db; const replica::table& _base; schema_ptr _schema; // The base schema std::vector _view_updates; @@ -259,12 +261,13 @@ class view_update_builder { partition_key _key = partition_key::make_empty(); public: - view_update_builder(const replica::table& base, schema_ptr s, + view_update_builder(data_dictionary::database db, const replica::table& base, schema_ptr s, std::vector&& views_to_update, flat_mutation_reader_v2&& updates, flat_mutation_reader_v2_opt&& existings, gc_clock::time_point now) - : _base(base) + : _db(std::move(db)) + , _base(base) , _schema(std::move(s)) , _view_updates(std::move(views_to_update)) , _updates(std::move(updates)) @@ -298,6 +301,7 @@ private: }; view_update_builder make_view_update_builder( + data_dictionary::database db, const replica::table& base_table, const schema_ptr& base_schema, std::vector&& views_to_update, diff --git a/replica/table.cc b/replica/table.cc index 58f27e5064..cebf23a814 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -2014,6 +2014,7 @@ future<> table::generate_and_propagate_view_updates(shared_ptrget_db().as_data_dictionary(), *this, base, std::move(views), @@ -2151,6 +2152,7 @@ future<> table::populate_views( gc_clock::time_point now) { auto schema = reader.schema(); db::view::view_update_builder builder = db::view::make_view_update_builder( + gen->get_db().as_data_dictionary(), *this, schema, std::move(views),