Skip to content

Commit caffe39

Browse files
committed
Use digit separator in literals.
1 parent 21f5da3 commit caffe39

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/MySqlConnector/MySqlClient/CommandExecutors/TextCommandExecutor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ public virtual async Task<DbDataReader> ExecuteReaderAsync(string commandText, M
6363
await m_command.Connection.Session.SendAsync(payload, ioBehavior, cancellationToken).ConfigureAwait(false);
6464
return await MySqlDataReader.CreateAsync(m_command, behavior, ioBehavior, cancellationToken).ConfigureAwait(false);
6565
}
66-
catch (Exception ex) when (payload.ArraySegment.Count > 4194304 && (ex is SocketException || ex is IOException || ex is MySqlProtocolException))
66+
catch (Exception ex) when (payload.ArraySegment.Count > 4_194_304 && (ex is SocketException || ex is IOException || ex is MySqlProtocolException))
6767
{
6868
// the default MySQL Server value for max_allowed_packet (in MySQL 5.7) is 4MiB: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_allowed_packet
6969
// use "decimal megabytes" (to round up) when creating the exception message
70-
int megabytes = payload.ArraySegment.Count / 1000000;
70+
int megabytes = payload.ArraySegment.Count / 1_000_000;
7171
throw new MySqlException("Error submitting {0}MB packet; ensure 'max_allowed_packet' is greater than {0}MB.".FormatInvariant(megabytes), ex);
7272
}
7373
}

src/MySqlConnector/Serialization/HandshakeResponse41Packet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ private static PayloadWriter CreateCapabilitiesPayload(ProtocolCapabilities serv
2424
(cs.UseAffectedRows ? 0 : ProtocolCapabilities.FoundRows) |
2525
(cs.UseCompression ? ProtocolCapabilities.Compress : ProtocolCapabilities.None) |
2626
additionalCapabilities));
27-
writer.WriteInt32(0x40000000);
27+
writer.WriteInt32(0x4000_0000);
2828
writer.WriteByte((byte) CharacterSet.Utf8Mb4Binary);
2929
writer.Write(new byte[23]);
3030

src/MySqlConnector/Serialization/ProtocolCapabilities.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,46 +85,46 @@ internal enum ProtocolCapabilities
8585
/// <summary>
8686
/// Can handle multiple statements per COM_QUERY and COM_STMT_PREPARE.
8787
/// </summary>
88-
MultiStatements = 0x10000,
88+
MultiStatements = 0x1_0000,
8989

9090
/// <summary>
9191
/// Can send multiple resultsets for COM_QUERY.
9292
/// </summary>
93-
MultiResults = 0x20000,
93+
MultiResults = 0x2_0000,
9494

9595
/// <summary>
9696
/// Can send multiple resultsets for COM_STMT_EXECUTE.
9797
/// </summary>
98-
PreparedStatementMultiResults = 0x40000,
98+
PreparedStatementMultiResults = 0x4_0000,
9999

100100
/// <summary>
101101
/// Sends extra data in Initial Handshake Packet and supports the pluggable authentication protocol.
102102
/// </summary>
103-
PluginAuth = 0x80000,
103+
PluginAuth = 0x8_0000,
104104

105105
/// <summary>
106106
/// Permits connection attributes in Protocol::HandshakeResponse41.
107107
/// </summary>
108-
ConnectAttributes = 0x100000,
108+
ConnectAttributes = 0x10_0000,
109109

110110
/// <summary>
111111
/// Understands length-encoded integer for auth response data in Protocol::HandshakeResponse41.
112112
/// </summary>
113-
PluginAuthLengthEncodedClientData = 0x200000,
113+
PluginAuthLengthEncodedClientData = 0x20_0000,
114114

115115
/// <summary>
116116
/// Announces support for expired password extension.
117117
/// </summary>
118-
CanHandleExpiredPasswords = 0x400000,
118+
CanHandleExpiredPasswords = 0x40_0000,
119119

120120
/// <summary>
121121
/// Can set SERVER_SESSION_STATE_CHANGED in the Status Flags and send session-state change data after a OK packet.
122122
/// </summary>
123-
SessionTrack = 0x800000,
123+
SessionTrack = 0x80_0000,
124124

125125
/// <summary>
126126
/// Can send OK after a Text Resultset.
127127
/// </summary>
128-
DeprecateEof = 0x1000000,
128+
DeprecateEof = 0x100_0000,
129129
}
130130
}

0 commit comments

Comments
 (0)