mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-21 17:10:35 +00:00
type: Fix _is_byte_order_comparable calculation
Because the length preceeds component contents, serialized tuples are not byte order comparable. It breaks lexi ordering. It should be that "abc" < "b", but with length prefix "<3>abc" is greater than "<1>b". Only single element tuples can be byte order capared because they have no length component. Spotted during code review.
This commit is contained in:
4
tuple.hh
4
tuple.hh
@@ -47,9 +47,7 @@ public:
|
||||
, _byte_order_equal(std::all_of(_types.begin(), _types.end(), [] (auto t) {
|
||||
return t->is_byte_order_equal();
|
||||
}))
|
||||
, _byte_order_comparable(std::all_of(_types.begin(), _types.end(), [] (auto t) {
|
||||
return t->is_byte_order_comparable();
|
||||
}))
|
||||
, _byte_order_comparable(_types.size() == 1 && _types[0]->is_byte_order_comparable())
|
||||
{ }
|
||||
|
||||
tuple_type(tuple_type&&) = default;
|
||||
|
||||
Reference in New Issue
Block a user