diff --git a/dbms/src/Common/COWPtr.h b/dbms/src/Common/COWPtr.h index ab02a330ba9..88b4f0b7740 100644 --- a/dbms/src/Common/COWPtr.h +++ b/dbms/src/Common/COWPtr.h @@ -216,7 +216,7 @@ protected: chameleon_ptr(std::initializer_list && arg) : value(std::forward>(arg)) {} const T * get() const { return value.get(); } - T * get() { return value->assumeMutable().get(); } + T * get() { return &value->assumeMutableRef(); } const T * operator->() const { return get(); } T * operator->() { return get(); } diff --git a/dbms/src/Interpreters/Set.cpp b/dbms/src/Interpreters/Set.cpp index c1cf279aee0..9932bca84a0 100644 --- a/dbms/src/Interpreters/Set.cpp +++ b/dbms/src/Interpreters/Set.cpp @@ -197,7 +197,7 @@ bool Set::insertFromBlock(const Block & block) if (set_elements[i]->empty()) set_elements[i] = filtered_column; else - set_elements[i]->assumeMutableRef().insertRangeFrom(*filtered_column, 0, filtered_column->size()); + set_elements[i]->insertRangeFrom(*filtered_column, 0, filtered_column->size()); } } diff --git a/dbms/src/Interpreters/Set.h b/dbms/src/Interpreters/Set.h index ab6299a5891..e069a74059c 100644 --- a/dbms/src/Interpreters/Set.h +++ b/dbms/src/Interpreters/Set.h @@ -68,7 +68,7 @@ public: const DataTypes & getDataTypes() const { return data_types; } bool hasExplicitSetElements() const { return fill_set_elements; } - const Columns & getSetElements() const { return set_elements; } + Columns getSetElements() const { return { set_elements.begin(), set_elements.end() }; } private: size_t keys_size = 0; @@ -113,7 +113,7 @@ private: /// Collected elements of `Set`. /// It is necessary for the index to work on the primary key in the IN statement. - Columns set_elements; + std::vector set_elements; /** Protects work with the set in the functions `insertFromBlock` and `execute`. * These functions can be called simultaneously from different threads only when using StorageSet, diff --git a/dbms/src/Storages/MergeTree/MergeTreeBloomFilterIndex.cpp b/dbms/src/Storages/MergeTree/MergeTreeBloomFilterIndex.cpp index 15a5d22f757..9c2a52f0a47 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeBloomFilterIndex.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeBloomFilterIndex.cpp @@ -457,7 +457,7 @@ bool BloomFilterCondition::tryPrepareSetBloomFilter( std::vector> bloom_filters; std::vector key_position; - const auto & columns = prepared_set->getSetElements(); + Columns columns = prepared_set->getSetElements(); for (size_t col = 0; col < key_tuple_mapping.size(); ++col) { bloom_filters.emplace_back();