You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ColumnType.Date or ColumnType.DateTime or ColumnType.NewDate or ColumnType.Timestamp or ColumnType.Time=>reader.ReadByte(),
52
-
ColumnType.DateTime2 or ColumnType.Timestamp2=>thrownewNotSupportedException("ColumnType {0} is not supported".FormatInvariant(columnDefinition.ColumnType)),
52
+
ColumnType.DateTime2 or ColumnType.Timestamp2=>thrownewNotSupportedException($"ColumnType {columnDefinition.ColumnType} is not supported"),
returnUtf8Parser.TryParse(data,outGuidguid,outintguid36BytesConsumed,'D')&&guid36BytesConsumed==36?guid:thrownewFormatException("Could not parse CHAR(36) value as Guid: {0}".FormatInvariant(Encoding.UTF8.GetString(data)));
101
+
returnUtf8Parser.TryParse(data,outGuidguid,outintguid36BytesConsumed,'D')&&guid36BytesConsumed==36?guid:thrownewFormatException($"Could not parse CHAR(36) value as Guid: {Encoding.UTF8.GetString(data)}");
returnUtf8Parser.TryParse(data,outGuidguid,outintguid32BytesConsumed,'N')&&guid32BytesConsumed==32?guid:thrownewFormatException("Could not parse CHAR(32) value as Guid: {0}".FormatInvariant(Encoding.UTF8.GetString(data)));
103
+
returnUtf8Parser.TryParse(data,outGuidguid,outintguid32BytesConsumed,'N')&&guid32BytesConsumed==32?guid:thrownewFormatException($"Could not parse CHAR(32) value as Guid: {Encoding.UTF8.GetString(data)}");
Copy file name to clipboardExpand all lines: src/MySqlConnector/Core/CommandExecutor.cs
+1-1
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ public static async Task<MySqlDataReader> ExecuteReaderAsync(IReadOnlyList<IMySq
65
65
// 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
66
66
// use "decimal megabytes" (to round up) when creating the exception message
67
67
intmegabytes=payload.Span.Length/1_000_000;
68
-
thrownewMySqlException("Error submitting {0}MB packet; ensure 'max_allowed_packet' is greater than {0}MB.".FormatInvariant(megabytes),ex);
68
+
thrownewMySqlException($"Error submitting {megabytes}MB packet; ensure 'max_allowed_packet' is greater than {megabytes}MB.",ex);
Log.Info("Pool{0} creating new connection pool for ConnectionString: {1}",m_logArguments[0],cs.ConnectionStringBuilder.GetConnectionString(includePassword:false));
Log.Error("Session{0} couldn't use AuthenticationMethod '{1}' because RSA key wasn't specified or couldn't be retrieved",m_logArguments);
865
-
thrownewMySqlException(MySqlErrorCode.UnableToConnectToHost,"Authentication method '{0}' failed. Either use a secure connection, specify the server's RSA public key with ServerRSAPublicKeyFile, or set AllowPublicKeyRetrieval=True.".FormatInvariant(switchRequestName));
865
+
thrownewMySqlException(MySqlErrorCode.UnableToConnectToHost,$"Authentication method '{switchRequestName}' failed. Either use a secure connection, specify the server's RSA public key with ServerRSAPublicKeyFile, or set AllowPublicKeyRetrieval=True.");
Log.Error("Session{0} should have SessionStateExpected {1} but was SessionState {2}",m_logArguments[0],state,m_state);
1796
-
thrownewInvalidOperationException("Expected state to be {0} but was {1}.".FormatInvariant(state,m_state));
1796
+
thrownewInvalidOperationException($"Expected state to be {state} but was {m_state}.");
1797
1797
}
1798
1798
}
1799
1799
@@ -1803,7 +1803,7 @@ private void VerifyState(State state1, State state2, State state3, State state4,
1803
1803
{
1804
1804
Log.Error("Session{0} should have SessionStateExpected {1} or SessionStateExpected2 {2} or SessionStateExpected3 {3} or SessionStateExpected4 {4} or SessionStateExpected5 {5} or SessionStateExpected6 {6} but was SessionState {7}",
thrownewInvalidOperationException("Expected state to be ({0}|{1}|{2}|{3}|{4}|{5}) but was {6}.".FormatInvariant(state1,state2,state3,state4,state5,state6,m_state));
1806
+
thrownewInvalidOperationException($"Expected state to be ({state1}|{state2}|{state3}|{state4}|{state5}|{state6}) but was {m_state}.");
thrownewMySqlException("Parameter index {0} is invalid when only {1} parameter{2} defined.".FormatInvariant(parameterIndex,parameterCollection?.Count??0,parameterCollection?.Count==1?" is":"s are"));
124
+
thrownewMySqlException($"Parameter index {parameterIndex} is invalid when only {parameterCollection?.Count??0} parameter{(parameterCollection?.Count==1?" is":"s are")} defined.");
0 commit comments