@@ -726,7 +726,7 @@ def __del__(self):
726
726
def autocommit (self , value ):
727
727
self .autocommit_mode = bool (value )
728
728
current = self .get_autocommit ()
729
- self .next_packet = 1
729
+ self ._next_packet = 1
730
730
if value != current :
731
731
self ._send_autocommit_mode ()
732
732
@@ -816,15 +816,15 @@ def query(self, sql, unbuffered=False):
816
816
"You may not close previous cursor." )
817
817
# if DEBUG:
818
818
# print("DEBUG: sending query:", sql)
819
- self .next_packet = 1
819
+ self ._next_packet = 1
820
820
if isinstance (sql , text_type ) and not (JYTHON or IRONPYTHON ):
821
821
if PY2 :
822
822
sql = sql .encode (self .encoding )
823
823
else :
824
824
sql = sql .encode (self .encoding , 'surrogateescape' )
825
825
self ._execute_command (COMMAND .COM_QUERY , sql )
826
826
self ._affected_rows = self ._read_query_result (unbuffered = unbuffered )
827
- self .next_packet = 1
827
+ self ._next_packet = 1
828
828
return self ._affected_rows
829
829
830
830
def next_result (self , unbuffered = False ):
@@ -892,7 +892,7 @@ def connect(self, sock=None):
892
892
sock .setsockopt (socket .SOL_SOCKET , socket .SO_KEEPALIVE , 1 )
893
893
self .socket = sock
894
894
self ._rfile = _makefile (sock , 'rb' )
895
- self .next_packet = 0
895
+ self ._next_packet = 0
896
896
897
897
self ._get_server_information ()
898
898
self ._request_authentication ()
@@ -938,11 +938,11 @@ def write_packet(self, data):
938
938
addings its length and sequence number. Intended for use by plugins
939
939
only.
940
940
"""
941
- data = pack_int24 (len (data )) + int2byte (self .next_packet ) + data
941
+ data = pack_int24 (len (data )) + int2byte (self ._next_packet ) + data
942
942
if DEBUG : dump_packet (data )
943
943
944
944
self ._write_bytes (data )
945
- self .next_packet = (self .next_packet + 1 ) % 256
945
+ self ._next_packet = (self ._next_packet + 1 ) % 256
946
946
947
947
def _read_packet (self , packet_type = MysqlPacket ):
948
948
"""Read an entire "mysql packet" in its entirety from the network
@@ -962,13 +962,13 @@ def _read_packet(self, packet_type=MysqlPacket):
962
962
continue
963
963
if bytes_to_read < MAX_PACKET_LEN :
964
964
break
965
- if packet_number != self .next_packet :
965
+ if packet_number != self ._next_packet :
966
966
pass
967
967
#TODO: check sequence id
968
968
#raise err.InternalError("Packet sequence number wrong - got %d expected %d" %
969
- # (packet_number, self.next_packet ))
969
+ # (packet_number, self._next_packet ))
970
970
971
- self .next_packet = (packet_number + 1 ) % 256
971
+ self ._next_packet = (packet_number + 1 ) % 256
972
972
packet = packet_type (buff , self .encoding )
973
973
packet .check_error ()
974
974
return packet
@@ -1037,7 +1037,7 @@ def _execute_command(self, command, sql):
1037
1037
self ._write_bytes (prelude + sql [:chunk_size - 1 ])
1038
1038
if DEBUG : dump_packet (prelude + sql )
1039
1039
1040
- self .next_packet = 1
1040
+ self ._next_packet = 1
1041
1041
if chunk_size < self .max_allowed_packet :
1042
1042
return
1043
1043
@@ -1053,7 +1053,7 @@ def _execute_command(self, command, sql):
1053
1053
if not sql and chunk_size < self .max_allowed_packet :
1054
1054
break
1055
1055
seq_id += 1
1056
- self .next_packet = seq_id % 256
1056
+ self ._next_packet = seq_id % 256
1057
1057
1058
1058
def _request_authentication (self ):
1059
1059
# https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse
0 commit comments