@@ -421,7 +421,7 @@ def __init__(self, cqlversion, options):
421
421
self .cqlversion = cqlversion
422
422
self .options = options
423
423
424
- def send_body (self , f , protocol_version ):
424
+ def send_body (self , f , protocol_version , protocol_features ):
425
425
optmap = self .options .copy ()
426
426
optmap ['CQL_VERSION' ] = self .cqlversion
427
427
write_stringmap (f , optmap )
@@ -456,7 +456,7 @@ class CredentialsMessage(_MessageType):
456
456
def __init__ (self , creds ):
457
457
self .creds = creds
458
458
459
- def send_body (self , f , protocol_version ):
459
+ def send_body (self , f , protocol_version , protocol_features ):
460
460
if protocol_version > 1 :
461
461
raise UnsupportedOperation (
462
462
"Credentials-based authentication is not supported with "
@@ -487,7 +487,7 @@ class AuthResponseMessage(_MessageType):
487
487
def __init__ (self , response ):
488
488
self .response = response
489
489
490
- def send_body (self , f , protocol_version ):
490
+ def send_body (self , f , protocol_version , protocol_features ):
491
491
write_longstring (f , self .response )
492
492
493
493
@@ -507,7 +507,7 @@ class OptionsMessage(_MessageType):
507
507
opcode = 0x05
508
508
name = 'OPTIONS'
509
509
510
- def send_body (self , f , protocol_version ):
510
+ def send_body (self , f , protocol_version , protocol_features ):
511
511
pass
512
512
513
513
@@ -645,7 +645,7 @@ def __init__(self, query, consistency_level, serial_consistency_level=None,
645
645
super (QueryMessage , self ).__init__ (None , consistency_level , serial_consistency_level , fetch_size ,
646
646
paging_state , timestamp , False , continuous_paging_options , keyspace )
647
647
648
- def send_body (self , f , protocol_version ):
648
+ def send_body (self , f , protocol_version , protocol_features ):
649
649
write_longstring (f , self .query )
650
650
self ._write_query_params (f , protocol_version )
651
651
@@ -681,9 +681,9 @@ def _write_query_params(self, f, protocol_version):
681
681
else :
682
682
super (ExecuteMessage , self )._write_query_params (f , protocol_version )
683
683
684
- def send_body (self , f , protocol_version ):
684
+ def send_body (self , f , protocol_version , protocol_features ):
685
685
write_string (f , self .query_id )
686
- if ProtocolVersion .uses_prepared_metadata (protocol_version ):
686
+ if ProtocolVersion .uses_prepared_metadata (protocol_version ) or protocol_features . use_metadata_id :
687
687
write_string (f , self .result_metadata_id )
688
688
self ._write_query_params (f , protocol_version )
689
689
@@ -734,15 +734,15 @@ class ResultMessage(_MessageType):
734
734
def __init__ (self , kind ):
735
735
self .kind = kind
736
736
737
- def recv (self , f , protocol_version , user_type_map , result_metadata , column_encryption_policy ):
737
+ def recv (self , f , protocol_version , protocol_features , user_type_map , result_metadata , column_encryption_policy ):
738
738
if self .kind == RESULT_KIND_VOID :
739
739
return
740
740
elif self .kind == RESULT_KIND_ROWS :
741
741
self .recv_results_rows (f , protocol_version , user_type_map , result_metadata , column_encryption_policy )
742
742
elif self .kind == RESULT_KIND_SET_KEYSPACE :
743
743
self .new_keyspace = read_string (f )
744
744
elif self .kind == RESULT_KIND_PREPARED :
745
- self .recv_results_prepared (f , protocol_version , user_type_map )
745
+ self .recv_results_prepared (f , protocol_version , protocol_features , user_type_map )
746
746
elif self .kind == RESULT_KIND_SCHEMA_CHANGE :
747
747
self .recv_results_schema_change (f , protocol_version )
748
748
else :
@@ -752,7 +752,7 @@ def recv(self, f, protocol_version, user_type_map, result_metadata, column_encry
752
752
def recv_body (cls , f , protocol_version , protocol_features , user_type_map , result_metadata , column_encryption_policy ):
753
753
kind = read_int (f )
754
754
msg = cls (kind )
755
- msg .recv (f , protocol_version , user_type_map , result_metadata , column_encryption_policy )
755
+ msg .recv (f , protocol_version , protocol_features , user_type_map , result_metadata , column_encryption_policy )
756
756
return msg
757
757
758
758
def recv_results_rows (self , f , protocol_version , user_type_map , result_metadata , column_encryption_policy ):
@@ -785,9 +785,9 @@ def decode_row(row):
785
785
col_md [3 ].cql_parameterized_type (),
786
786
str (e )))
787
787
788
- def recv_results_prepared (self , f , protocol_version , user_type_map ):
788
+ def recv_results_prepared (self , f , protocol_version , protocol_features , user_type_map ):
789
789
self .query_id = read_binary_string (f )
790
- if ProtocolVersion .uses_prepared_metadata (protocol_version ):
790
+ if ProtocolVersion .uses_prepared_metadata (protocol_version ) or protocol_features . use_metadata_id :
791
791
self .result_metadata_id = read_binary_string (f )
792
792
else :
793
793
self .result_metadata_id = None
@@ -909,7 +909,7 @@ def __init__(self, query, keyspace=None):
909
909
self .query = query
910
910
self .keyspace = keyspace
911
911
912
- def send_body (self , f , protocol_version ):
912
+ def send_body (self , f , protocol_version , protocol_features ):
913
913
write_longstring (f , self .query )
914
914
915
915
flags = 0x00
@@ -953,7 +953,7 @@ def __init__(self, batch_type, queries, consistency_level,
953
953
self .timestamp = timestamp
954
954
self .keyspace = keyspace
955
955
956
- def send_body (self , f , protocol_version ):
956
+ def send_body (self , f , protocol_version , protocol_features ):
957
957
write_byte (f , self .batch_type .value )
958
958
write_short (f , len (self .queries ))
959
959
for prepared , string_or_query_id , params in self .queries :
@@ -1012,7 +1012,7 @@ class RegisterMessage(_MessageType):
1012
1012
def __init__ (self , event_list ):
1013
1013
self .event_list = event_list
1014
1014
1015
- def send_body (self , f , protocol_version ):
1015
+ def send_body (self , f , protocol_version , protocol_features ):
1016
1016
write_stringlist (f , self .event_list )
1017
1017
1018
1018
@@ -1086,7 +1086,7 @@ def __init__(self, op_type, op_id, next_pages=0):
1086
1086
self .op_id = op_id
1087
1087
self .next_pages = next_pages
1088
1088
1089
- def send_body (self , f , protocol_version ):
1089
+ def send_body (self , f , protocol_version , protocol_features ):
1090
1090
write_int (f , self .op_type )
1091
1091
write_int (f , self .op_id )
1092
1092
if self .op_type == ReviseRequestMessage .RevisionType .PAGING_BACKPRESSURE :
@@ -1122,7 +1122,7 @@ class _ProtocolHandler(object):
1122
1122
"""Instance of :class:`cassandra.policies.ColumnEncryptionPolicy` in use by this handler"""
1123
1123
1124
1124
@classmethod
1125
- def encode_message (cls , msg , stream_id , protocol_version , compressor , allow_beta_protocol_version ):
1125
+ def encode_message (cls , msg , stream_id , protocol_version , protocol_features , compressor , allow_beta_protocol_version ):
1126
1126
"""
1127
1127
Encodes a message using the specified frame parameters, and compressor
1128
1128
@@ -1138,7 +1138,7 @@ def encode_message(cls, msg, stream_id, protocol_version, compressor, allow_beta
1138
1138
raise UnsupportedOperation ("Custom key/value payloads can only be used with protocol version 4 or higher" )
1139
1139
flags |= CUSTOM_PAYLOAD_FLAG
1140
1140
write_bytesmap (body , msg .custom_payload )
1141
- msg .send_body (body , protocol_version )
1141
+ msg .send_body (body , protocol_version , protocol_features )
1142
1142
body = body .getvalue ()
1143
1143
1144
1144
# With checksumming, the compression is done at the segment frame encoding
0 commit comments