Description:
This is a regression in Connector/NET 8.1.0 from 8.0.33.
When MySqlCommandBuilder.DeriveParameters(cmd) is called for a StoredProcedure command for a sproc that has a BIT(n) parameter, the returned MySqlParameter has a Size property of 0. Previously, it had the size of the BIT(n) column, i.e., n.
How to repeat:
Run the following C# code:
using var connection = new MySqlConnection("...");
connection.Open();
// SET THIS TO ANY VALUE FROM 1 TO 64
var bitSize = 1;
using (var cmd = new MySqlCommand($"drop procedure if exists parameter_size; create procedure parameter_size(in param1 bit({bitSize})) begin end;", connection))
cmd.ExecuteNonQuery();
using (var cmd = new MySqlCommand("parameter_size", connection))
{
cmd.CommandType = CommandType.StoredProcedure;
MySqlCommandBuilder.DeriveParameters(cmd);
// ** In MySql.Data 8.0.33, prints the value of bitSize from above
// ** In MySql.Data 8.1.0, always prints 0
Console.WriteLine(cmd.Parameters[0].Size);
}
Description: This is a regression in Connector/NET 8.1.0 from 8.0.33. When MySqlCommandBuilder.DeriveParameters(cmd) is called for a StoredProcedure command for a sproc that has a BIT(n) parameter, the returned MySqlParameter has a Size property of 0. Previously, it had the size of the BIT(n) column, i.e., n. How to repeat: Run the following C# code: using var connection = new MySqlConnection("..."); connection.Open(); // SET THIS TO ANY VALUE FROM 1 TO 64 var bitSize = 1; using (var cmd = new MySqlCommand($"drop procedure if exists parameter_size; create procedure parameter_size(in param1 bit({bitSize})) begin end;", connection)) cmd.ExecuteNonQuery(); using (var cmd = new MySqlCommand("parameter_size", connection)) { cmd.CommandType = CommandType.StoredProcedure; MySqlCommandBuilder.DeriveParameters(cmd); // ** In MySql.Data 8.0.33, prints the value of bitSize from above // ** In MySql.Data 8.1.0, always prints 0 Console.WriteLine(cmd.Parameters[0].Size); }