query: fix non full clustering key deserialization

Clustering key prefix may have less columns than described in schema.
Deserailiaztion should stop when end of buffer is reached.

Message-Id: <20160503140420.GP23113@scylladb.com>
This commit is contained in:
Gleb Natapov
2016-05-03 17:04:20 +03:00
committed by Tomasz Grabiec
parent 5aeeb0b3e8
commit 2a00c06dd5

View File

@@ -141,6 +141,9 @@ result_set_builder::deserialize(const clustering_key& key)
std::unordered_map<sstring, data_value> cells;
auto i = key.begin(*_schema);
for (auto&& col : _schema->clustering_key_columns()) {
if (i == key.end(*_schema)) {
break;
}
cells.emplace(col.name_as_text(), col.type->deserialize_value(*i));
++i;
}