Skip to content

Commit 3bc5adc

Browse files
authored
Merge pull request apache#680 from datastax/PYTHON-684
Send a flags field (value 0) in PREPARE messages in v5.
2 parents e932c93 + ae18522 commit 3bc5adc

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

cassandra/protocol.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
UserAggregateDescriptor, SchemaTargetType)
3131
from cassandra.marshal import (int32_pack, int32_unpack, uint16_pack, uint16_unpack,
3232
int8_pack, int8_unpack, uint64_pack, header_pack,
33-
v3_header_pack)
33+
v3_header_pack, uint32_pack)
3434
from cassandra.cqltypes import (AsciiType, BytesType, BooleanType,
3535
CounterColumnType, DateType, DecimalType,
3636
DoubleType, FloatType, Int32Type,
@@ -561,7 +561,7 @@ def send_body(self, f, protocol_version):
561561
flags |= _PROTOCOL_TIMESTAMP
562562

563563
if protocol_version >= 5:
564-
write_int(f, flags)
564+
write_uint(f, flags)
565565
else:
566566
write_byte(f, flags)
567567

@@ -775,6 +775,9 @@ def __init__(self, query):
775775

776776
def send_body(self, f, protocol_version):
777777
write_longstring(f, self.query)
778+
if protocol_version >= 5:
779+
# Write the flags byte; with 0 value for now, but this should change in PYTHON-678
780+
write_uint(f, 0)
778781

779782

780783
class ExecuteMessage(_MessageType):
@@ -829,7 +832,7 @@ def send_body(self, f, protocol_version):
829832
flags |= _SKIP_METADATA_FLAG
830833

831834
if protocol_version >= 5:
832-
write_int(f, flags)
835+
write_uint(f, flags)
833836
else:
834837
write_byte(f, flags)
835838

@@ -1164,6 +1167,10 @@ def write_int(f, i):
11641167
f.write(int32_pack(i))
11651168

11661169

1170+
def write_uint(f, i):
1171+
f.write(uint32_pack(i))
1172+
1173+
11671174
def write_long(f, i):
11681175
f.write(uint64_pack(i))
11691176

0 commit comments

Comments
 (0)