From 9bb1f10bb6cbcbc1048de78bee2e7a20a476cfc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Mon, 9 Apr 2018 13:42:34 +0200 Subject: [PATCH] treewide: require type for comparing cells --- atomic_cell_or_collection.hh | 2 +- mutation_partition.cc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/atomic_cell_or_collection.hh b/atomic_cell_or_collection.hh index b3b69b123d..14e913a1a4 100644 --- a/atomic_cell_or_collection.hh +++ b/atomic_cell_or_collection.hh @@ -62,7 +62,7 @@ public: bytes_view serialize() const { return _data; } - bool operator==(const atomic_cell_or_collection& other) const { + bool equals(const abstract_type& type, const atomic_cell_or_collection& other) const { return _data == other._data; } size_t external_memory_usage(const abstract_type&) const { diff --git a/mutation_partition.cc b/mutation_partition.cc index c795f87a30..760d119d0f 100644 --- a/mutation_partition.cc +++ b/mutation_partition.cc @@ -1513,8 +1513,11 @@ bool row::equal(column_kind kind, const schema& this_schema, const row& other, c auto cells_equal = [&] (std::pair c1, std::pair c2) { static_assert(schema::row_column_ids_are_ordered_by_name::value, "Relying on column ids being ordered by name"); - return this_schema.column_at(kind, c1.first).name() == other_schema.column_at(kind, c2.first).name() - && c1.second == c2.second; + auto& at1 = *this_schema.column_at(kind, c1.first).type; + auto& at2 = other_schema.column_at(kind, c2.first).type; + return at1.equals(at2) + && this_schema.column_at(kind, c1.first).name() == other_schema.column_at(kind, c2.first).name() + && c1.second.equals(at1, c2.second); }; return with_both_ranges(other, [&] (auto r1, auto r2) { return boost::equal(r1, r2, cells_equal);