5
5
import datetime
6
6
import json
7
7
8
- from pymysql .util import byte2int
9
8
from pymysql .charset import charset_by_name
10
9
11
10
from .event import BinLogEvent
@@ -556,10 +555,10 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
556
555
self .flags = struct .unpack ('<H' , self .packet .read (2 ))[0 ]
557
556
558
557
# Payload
559
- self .schema_length = byte2int ( self .packet .read (1 ))
558
+ self .schema_length = struct . unpack ( "!B" , self .packet .read (1 ))[ 0 ]
560
559
self .schema = self .packet .read (self .schema_length ).decode ()
561
560
self .packet .advance (1 )
562
- self .table_length = byte2int ( self .packet .read (1 ))
561
+ self .table_length = struct . unpack ( "!B" , self .packet .read (1 ))[ 0 ]
563
562
self .table = self .packet .read (self .table_length ).decode ()
564
563
565
564
if self .__only_tables is not None and self .table not in self .__only_tables :
@@ -590,7 +589,7 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
590
589
591
590
if len (self .column_schemas ) != 0 :
592
591
# Read columns meta data
593
- column_types = list (self .packet .read (self .column_count ))
592
+ column_types = bytearray (self .packet .read (self .column_count ))
594
593
self .packet .read_length_coded_binary ()
595
594
for i in range (0 , len (column_types )):
596
595
column_type = column_types [i ]
@@ -617,7 +616,7 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
617
616
'COLUMN_TYPE' : 'BLOB' , # we don't know what it is, so let's not do anything with it.
618
617
'COLUMN_KEY' : '' ,
619
618
}
620
- col = Column (byte2int ( column_type ) , column_schema , from_packet )
619
+ col = Column (column_type , column_schema , from_packet )
621
620
self .columns .append (col )
622
621
623
622
self .table_obj = Table (self .column_schemas , self .table_id , self .schema ,
0 commit comments