Description:
Hi,
When calling the OpenAsync method of MySqlConnection, when the UseCompression of MySqlConnectionStringBuilder is set to true, a "EndOfStreamException: Attempted to read past the end of the stream" exception is thrown.
Using the Open method instead of the OpenAsync method works as expected.
Also, setting the UseCompression to false works as expected as well.
I'm using VS2022, dotnet 8, MySql.Data nuget package, version 9.0.0.
Thanks
How to repeat:
using MySql.Data.MySqlClient;
internal class Program
{
private static async Task<int> Main(string[] args)
{
var cancellationToken = new CancellationToken();
var mySqlConnectionStringBuilder = new MySqlConnectionStringBuilder
{
UserID = "userid", Password = "pass", Server = "server", Port = 3306, Database = "db",
UseCompression = true
};
await using (var dbConnection = new MySqlConnection(mySqlConnectionStringBuilder.ConnectionString))
{
await dbConnection.OpenAsync(cancellationToken);
await using (MySqlCommand queryCommand = new MySqlCommand("SELECT 1", dbConnection))
{
var res = await queryCommand.ExecuteNonQueryAsync(cancellationToken);
}
}
return 0;
}
}