MySQL Connector/NET Release Notes

2.6 Changes in MySQL Connector/NET 8.0.32 (2023-01-17, General Availability)

An Important Update

  • The Connector/NET MySql.Data version 8.0.32.1 NuGet package now is released and the newer package supersedes the original 8.0.32 package. All of the dotnet build warnings produced when compiling a program that references MySql.Data version 8.0.32 (and related issues) are resolved when referencing the MySql.Data 8.0.32.1 package. (Bug #109670, Bug #34990010)

Entity Framework 6 Notes

  • In some cases, the function that creates SQL queries did not specify an escape character properly. This fix adds a new method to handle the cases in which a string could require an escape character and applies it before building the SQL query. (Bug #103160, Bug #34498485)

  • When Connector/NET set the @@SESSION.sql_mode value to 'ANSI', it did so without considering the current value. (Bug #79678, Bug #22564126)

Pluggable Authentication

  • Connector/NET 8.0.27 implemented support for the SSPI Kerberos library on Windows, which was not capable of acquiring cached credentials previously generated by using kinit command. Connector/NET 8.0.32 also supports GSSAPI through the MIT Kerberos library to add that capability using the authentication_kerberos_client authentication plugin on Windows.

    A new connection option, KerberosAuthMode, enables developers using the classic MySQL protocol to attempt authentication at run time using a mode value specified at design time. These mode values are permitted:

    • AUTO (default value) – Use SSPI and fall back to GSSAPI in case of failure.

    • SSPI – Use SSPI only and raise an exception in case of failure.

    • GSSAPI – Use GSSAPI only and raise an exception in case of failure.

    Use of the KerberosAuthMode connection option is restricted to Windows. Its use raises an exception in non-Windows environments. For more information about the connector’s implementation of the client-side Kerberos authentication plugin, see authentication_kerberos_client. (WL #15341)

Functionality Added or Changed

  • This release of Connector/NET upgrades the NuGet package reference for Google.Protobuf to version 3.21.9, which has been publicly reported as not vulnerable to CVE-2022-3171. (Bug #34859629, WL #15408)

  • To enhance the performance of connections, Connector/NET now determines whether a connection string has been analyzed already before performing the analysis for a second time. (Bug #102964, Bug #32680315)

  • It is now possible to pass a stream object to the MySqlBulkLoader.Load() method for copying bulk data to a database. Our thanks to Alexander Reinert for the patch. (Bug #74392, Bug #21049228)

  • Connector/NET now fully supports .NET 7 and Entity Framework Core 7.0 (EF7) for applications that target .NET 7 exclusively. Previously, Connector/NET 8.0.31 supported the .NET 7 and EF7 previews. (WL #15334)

Bugs Fixed

  • Connector/NET could not authenticate a valid client user through Oracle Cloud Infrastructure pluggable authentication. Now, the connector implements new constraints to ensure that the client-side plugin loads the OCI.DotNetSDK.Common assembly, which contains the required functions needed to authenticate a client user. (Bug #34851463)

  • When unloading the assembly, the procedure recommended by Microsoft was not performed accurately for .NET Core frameworks. Our thanks to Gabriele Gervasi for the patch. (Bug #108837, Bug #34724334)

  • An unexpected System.NullReferenceException message was returned when the MySqlCommand.Cancel() method was called for a command associated with a closed (or disposed) MySqlConnection object. The issue is resolved with new validation in the method that now checks the connection state. (Bug #101507, Bug #32127591)

  • Some methods of the MySqlDataReader class that should retrieve an integer value instead could return unexpected values. This behavior had multiple causes. First, the connector was not properly informed by the TreatTinyAsBoolean property that it should treat type TINYINT(1) as INT or BOOL. In addition, Connector/NET implemented the conversion to a different type inconsistently. (Bug #99091, Bug #31087580)

  • When executing multiple INSERT statements in one MySQLCommand call, the LastInsertedId property was set to zero because the connector read an extra OK packet from the server that omitted LastInsertedId. Now, Connector/NET avoids overriding the value if it is set. (Bug #97061, Bug #30365157)

  • Improved validation now ensures that the MySqlParameterCollection.Add() method behaves consistently when it checks whether a named parameter has been added already. (Bug #93370, Bug #28980952)

  • Values of the Size, Scale, Precision, IsNullable, and SourceColumnNullMapping properties were omitted during the copy operation performed by the MySqlParameter.Clone() method. (Bug #92734, Bug #28777779)

  • The MySqlException.Number property for authentication-related exceptions always returned a value of zero. (Bug #78426, Bug #21830667)

  • Output parameters in combination with a command of type CommandType.Text were not supported. This fix changed how Connector/NET manages the parameters with an output direction for text commands. (Bug #75267, Bug #20259756)