Fix routing key encoding for compound primary keys
- make component size big-endian - include component string size in format string
This commit is contained in:
@@ -507,7 +507,8 @@ class BoundStatement(Statement):
|
|||||||
components = []
|
components = []
|
||||||
for statement_index in routing_indexes:
|
for statement_index in routing_indexes:
|
||||||
val = self.values[statement_index]
|
val = self.values[statement_index]
|
||||||
components.append(struct.pack("HsB", len(val), val, 0))
|
l = len(val)
|
||||||
|
components.append(struct.pack(">H%dsB" % l, l, val, 0))
|
||||||
|
|
||||||
self._routing_key = b"".join(components)
|
self._routing_key = b"".join(components)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user