Skip to content

Commit

Permalink
row_cache: Fix bug in populate()
Browse files Browse the repository at this point in the history
lower_bound() of course can return an iterator to an entry which has a
different key.
  • Loading branch information
tgrabiec committed Jul 27, 2015
1 parent 3e76675 commit 31d28c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion row_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void row_cache::populate(const mutation& m) {

void row_cache::populate(mutation&& m) {
auto i = _partitions.lower_bound(m.decorated_key(), cache_entry::compare(_schema));
if (i == _partitions.end()) {
if (i == _partitions.end() || !i->key().equal(*_schema, m.decorated_key())) {
cache_entry* entry = new cache_entry(m.decorated_key(), std::move(m.partition()));
_tracker.insert(*entry);
_partitions.insert(i, *entry);
Expand Down

0 comments on commit 31d28c5

Please sign in to comment.