File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
src/MySqlConnector/Protocol/Payloads Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -43,22 +43,25 @@ public static OkPayload Create(ReadOnlySpan<byte> span, bool deprecateEof)
43
43
{
44
44
reader . ReadLengthEncodedByteString ( ) ; // human-readable info
45
45
46
- // implies ProtocolCapabilities.SessionTrack
47
- var sessionStateChangeDataLength = checked ( ( int ) reader . ReadLengthEncodedInteger ( ) ) ;
48
- var endOffset = reader . Offset + sessionStateChangeDataLength ;
49
- while ( reader . Offset < endOffset )
46
+ // If ProtocolCapabilities.SessionTrack is enabled, it will contains the information. Otherwise, it will contains Nothing.
47
+ if ( reader . BytesRemaining > 0 )
50
48
{
51
- var kind = ( SessionTrackKind ) reader . ReadByte ( ) ;
52
- var dataLength = ( int ) reader . ReadLengthEncodedInteger ( ) ;
53
- switch ( kind )
49
+ var sessionStateChangeDataLength = checked ( ( int ) reader . ReadLengthEncodedInteger ( ) ) ;
50
+ var endOffset = reader . Offset + sessionStateChangeDataLength ;
51
+ while ( reader . Offset < endOffset )
54
52
{
55
- case SessionTrackKind . Schema :
56
- newSchema = Encoding . UTF8 . GetString ( reader . ReadLengthEncodedByteString ( ) ) ;
57
- break ;
53
+ var kind = ( SessionTrackKind ) reader . ReadByte ( ) ;
54
+ var dataLength = ( int ) reader . ReadLengthEncodedInteger ( ) ;
55
+ switch ( kind )
56
+ {
57
+ case SessionTrackKind . Schema :
58
+ newSchema = Encoding . UTF8 . GetString ( reader . ReadLengthEncodedByteString ( ) ) ;
59
+ break ;
58
60
59
- default :
60
- reader . Offset += dataLength ;
61
- break ;
61
+ default :
62
+ reader . Offset += dataLength ;
63
+ break ;
64
+ }
62
65
}
63
66
}
64
67
}
You can’t perform that action at this time.
0 commit comments