@@ -421,7 +421,7 @@ def __init__(self, cqlversion, options):
421421self .cqlversion = cqlversion
422422self .options = options
423423
424- def send_body (self , f , protocol_version ):
424+ def send_body (self , f , protocol_version , protocol_features ):
425425optmap = self .options .copy ()
426426optmap ['CQL_VERSION' ] = self .cqlversion
427427write_stringmap (f , optmap )
@@ -456,7 +456,7 @@ class CredentialsMessage(_MessageType):
456456def __init__ (self , creds ):
457457self .creds = creds
458458
459- def send_body (self , f , protocol_version ):
459+ def send_body (self , f , protocol_version , protocol_features ):
460460if protocol_version > 1 :
461461raise UnsupportedOperation (
462462"Credentials-based authentication is not supported with "
@@ -487,7 +487,7 @@ class AuthResponseMessage(_MessageType):
487487def __init__ (self , response ):
488488self .response = response
489489
490- def send_body (self , f , protocol_version ):
490+ def send_body (self , f , protocol_version , protocol_features ):
491491write_longstring (f , self .response )
492492
493493
@@ -507,7 +507,7 @@ class OptionsMessage(_MessageType):
507507opcode = 0x05
508508name = 'OPTIONS'
509509
510- def send_body (self , f , protocol_version ):
510+ def send_body (self , f , protocol_version , protocol_features ):
511511pass
512512
513513
@@ -645,7 +645,7 @@ def __init__(self, query, consistency_level, serial_consistency_level=None,
645645super (QueryMessage , self ).__init__ (None , consistency_level , serial_consistency_level , fetch_size ,
646646paging_state , timestamp , False , continuous_paging_options , keyspace )
647647
648- def send_body (self , f , protocol_version ):
648+ def send_body (self , f , protocol_version , protocol_features ):
649649write_longstring (f , self .query )
650650self ._write_query_params (f , protocol_version )
651651
@@ -681,9 +681,9 @@ def _write_query_params(self, f, protocol_version):
681681else :
682682super (ExecuteMessage , self )._write_query_params (f , protocol_version )
683683
684- def send_body (self , f , protocol_version ):
684+ def send_body (self , f , protocol_version , protocol_features ):
685685write_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 :
687687write_string (f , self .result_metadata_id )
688688self ._write_query_params (f , protocol_version )
689689
@@ -734,15 +734,15 @@ class ResultMessage(_MessageType):
734734def __init__ (self , kind ):
735735self .kind = kind
736736
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 ):
738738if self .kind == RESULT_KIND_VOID :
739739return
740740elif self .kind == RESULT_KIND_ROWS :
741741self .recv_results_rows (f , protocol_version , user_type_map , result_metadata , column_encryption_policy )
742742elif self .kind == RESULT_KIND_SET_KEYSPACE :
743743self .new_keyspace = read_string (f )
744744elif 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 )
746746elif self .kind == RESULT_KIND_SCHEMA_CHANGE :
747747self .recv_results_schema_change (f , protocol_version )
748748else :
@@ -752,7 +752,7 @@ def recv(self, f, protocol_version, user_type_map, result_metadata, column_encry
752752def recv_body (cls , f , protocol_version , protocol_features , user_type_map , result_metadata , column_encryption_policy ):
753753kind = read_int (f )
754754msg = 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 )
756756return msg
757757
758758def recv_results_rows (self , f , protocol_version , user_type_map , result_metadata , column_encryption_policy ):
@@ -785,9 +785,9 @@ def decode_row(row):
785785col_md [3 ].cql_parameterized_type (),
786786str (e )))
787787
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 ):
789789self .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 :
791791self .result_metadata_id = read_binary_string (f )
792792else :
793793self .result_metadata_id = None
@@ -909,7 +909,7 @@ def __init__(self, query, keyspace=None):
909909self .query = query
910910self .keyspace = keyspace
911911
912- def send_body (self , f , protocol_version ):
912+ def send_body (self , f , protocol_version , protocol_features ):
913913write_longstring (f , self .query )
914914
915915flags = 0x00
@@ -953,7 +953,7 @@ def __init__(self, batch_type, queries, consistency_level,
953953self .timestamp = timestamp
954954self .keyspace = keyspace
955955
956- def send_body (self , f , protocol_version ):
956+ def send_body (self , f , protocol_version , protocol_features ):
957957write_byte (f , self .batch_type .value )
958958write_short (f , len (self .queries ))
959959for prepared , string_or_query_id , params in self .queries :
@@ -1012,7 +1012,7 @@ class RegisterMessage(_MessageType):
10121012def __init__ (self , event_list ):
10131013self .event_list = event_list
10141014
1015- def send_body (self , f , protocol_version ):
1015+ def send_body (self , f , protocol_version , protocol_features ):
10161016write_stringlist (f , self .event_list )
10171017
10181018
@@ -1086,7 +1086,7 @@ def __init__(self, op_type, op_id, next_pages=0):
10861086self .op_id = op_id
10871087self .next_pages = next_pages
10881088
1089- def send_body (self , f , protocol_version ):
1089+ def send_body (self , f , protocol_version , protocol_features ):
10901090write_int (f , self .op_type )
10911091write_int (f , self .op_id )
10921092if self .op_type == ReviseRequestMessage .RevisionType .PAGING_BACKPRESSURE :
@@ -1122,7 +1122,7 @@ class _ProtocolHandler(object):
11221122"""Instance of :class:`cassandra.policies.ColumnEncryptionPolicy` in use by this handler"""
11231123
11241124@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 ):
11261126"""
11271127 Encodes a message using the specified frame parameters, and compressor
11281128
@@ -1138,7 +1138,7 @@ def encode_message(cls, msg, stream_id, protocol_version, compressor, allow_beta
11381138raise UnsupportedOperation ("Custom key/value payloads can only be used with protocol version 4 or higher" )
11391139flags |= CUSTOM_PAYLOAD_FLAG
11401140write_bytesmap (body , msg .custom_payload )
1141- msg .send_body (body , protocol_version )
1141+ msg .send_body (body , protocol_version , protocol_features )
11421142body = body .getvalue ()
11431143
11441144# With checksumming, the compression is done at the segment frame encoding
0 commit comments