Bug #116382 ExecuteNonQueryAsync hangs with DDL if UseCompression=True
Submitted: 16 Oct 2024 20:09 Modified: 17 Oct 2024 6:48
Reporter: Bradley Grainger (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:8.0.33, 9.1.0 OS:Windows (10)
Assigned to: CPU Architecture:Other (x64)

[16 Oct 2024 20:09] Bradley Grainger
Description:
Starting with MySQL Connector/NET 8.0.33 and continuing through 9.1.0, calling ExecuteNonQueryAsync with multiple DDL statements hangs the calling application when the connection string uses UseCompression=True.

This does not occur with v8.0.32 and earlier, nor with ExecuteNonQuery, nor did I reproduce a hang with regular SELECT statements.

Not sure if possibly related to bug #116146, but this is a hang, not an exception.

How to repeat:
Run the following C# code:

var builder = new MySqlConnectionStringBuilder
{
	Server = "localhost",
	UserID = ...
	Password = ...
	Database = "an existing database",
	UseCompression = true, // ** IMPORTANT
};

using var connection = new MySqlConnection(builder.ConnectionString);
connection.Open();

using var command = connection.CreateCommand();
command.CommandText = @"drop table if exists execute_nonquery_async; create table execute_nonquery_async(id integer not null primary key auto_increment);";
Console.Write("Executing SQL...");
await command.ExecuteNonQueryAsync(); // hangs here
Console.WriteLine("done.");
[17 Oct 2024 6:48] MySQL Verification Team
Hello Bradley,

Thank you for the bug report.
Verified as described.

Sincerely,
Umesh Shastry