Bug #27679 | MySqlCommandBuilder.DeriveParameters ignores UNSIGNED flag | ||
---|---|---|---|
Submitted: | 5 Apr 2007 22:57 | Modified: | 3 May 2007 11:23 |
Reporter: | Matthew Endsley | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 5.0.6 | OS: | Windows (XP SP2) |
Assigned to: | CPU Architecture: | Any | |
Tags: | DeriveParameters, MySqlCommandBuilder, UNSIGNED |
[5 Apr 2007 22:57]
Matthew Endsley
[14 Apr 2007 10:02]
Tonci Grgin
Hi Matthew and thanks for excellent report. Your private remarks are true in our latest sources. Verified as described with - MySQL 5.0.38BK on WinXP Pro SP2 localhost - c/NET 5 rev 675 on NET FW 2 Test case: MySqlConnection conn = new MySqlConnection(); conn.ConnectionString = "DataSource=localhost;Database=test;UserID=root;Password=;PORT=3306;Allow Zero Datetime=True";//; conn.Open(); MySqlCommand cmdCreateTable = new MySqlCommand("drop procedure if exists spTestBug27679", conn); cmdCreateTable.CommandTimeout = 0; cmdCreateTable.ExecuteNonQuery(); cmdCreateTable.CommandText = ("CREATE PROCEDURE spTestBug27679 (IN id TINYINT UNSIGNED, OUT valo TINYINT UNSIGNED) " + "BEGIN SET valo = (id-1); END"); cmdCreateTable.ExecuteNonQuery(); MySqlCommand cmd = new MySqlCommand("spTestBug27679", conn); cmd.CommandTimeout = 0; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("?id", (155)); cmd.Parameters[0].DbType = DbType.Byte; cmd.Parameters[0].Direction = ParameterDirection.Input; cmd.Parameters.Add("?valo", MySqlDbType.UByte); cmd.Parameters[1].Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); Console.WriteLine("Test 1):"); Console.WriteLine("Param Id (TINYINT UNSIGNED) MySqlDbType: " + cmd.Parameters["?id"].MySqlDbType.ToString()); Console.WriteLine("Param valo (TINYINT UNSIGNED) MySqlDbType: " + cmd.Parameters["?valo"].MySqlDbType.ToString()); Debug.Assert(cmd.Parameters["?id"].MySqlDbType == MySqlDbType.UByte); Debug.Assert(cmd.Parameters["?id"].DbType == DbType.Byte); Console.WriteLine("Test 1) done."); //-- MySqlCommand cmd1 = new MySqlCommand("spTestBug27679", conn); cmd1.CommandTimeout = 0; cmd1.CommandType = CommandType.StoredProcedure; MySqlCommandBuilder.DeriveParameters(cmd1); Console.WriteLine("Test 2):"); Debug.Assert(cmd1.Parameters["?id"].MySqlDbType == MySqlDbType.UByte, "Assertation failed!", "(IN) Param Id MySQLDBType is " + cmd1.Parameters["?id"].MySqlDbType.ToString() + " instead of UByte"); Debug.Assert(cmd1.Parameters["?id"].DbType == DbType.Byte, "Assertation failed!", "(IN) Param Id DBType is " + cmd1.Parameters["?id"].DbType.ToString() + " instead of Byte"); Debug.Assert(cmd1.Parameters["?valo"].MySqlDbType == MySqlDbType.UByte, "Assertation failed!", "(OUT) Param valo MySQLDBType is " + cmd1.Parameters["?valo"].MySqlDbType.ToString() + " instead of UByte"); Debug.Assert(cmd1.Parameters["?valo"].DbType == DbType.Byte, "Assertation failed!", "(OUT) Param valo DBType is " + cmd1.Parameters["?valo"].DbType.ToString() + " instead of UByte"); Console.WriteLine("Test 2) done.");
[1 May 2007 20:57]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/25852
[1 May 2007 21:05]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/25853
[1 May 2007 21:06]
Reggie Burnett
Fixed in 5.0.7 and 5.1.1
[1 May 2007 21:12]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/25854
[3 May 2007 11:23]
MC Brown
A note has been added to the 5.0.7 and 5.1.1 changelogs.