Bug #25912 | selecting negative time values gets wrong results | ||
---|---|---|---|
Submitted: | 29 Jan 2007 12:09 | Modified: | 31 Jan 2007 16:21 |
Reporter: | Martin Karch | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 1.0.8, 5.0.3 | OS: | |
Assigned to: | CPU Architecture: | Any | |
Tags: | negative, result, retrieve, SELECT, time, value, wrong |
[29 Jan 2007 12:09]
Martin Karch
[29 Jan 2007 13:42]
Tonci Grgin
Hi Martin and thanks for your problem report. Verified as described on MySQL server 5.0.34BK on WinXP Pro SP2 localhost with NET FW 2.0 and latest c/NET 5.0 sources. Output: t = -06:36:00 ============================ t = -04:43:00 ============================ t = -05:51:00 ============================ t = -10:59:00 ============================ t = -13:00:00 ============================ Done. Test case: private void bnBug25912_Click(object sender, EventArgs e) { MySqlConnection conn = new MySqlConnection(); conn.ConnectionString = "DataSource=localhost;Database=test;UserID=root;Password=;PORT=3306";//Allow Zero Datetime=True - doesn't matter conn.Open(); MySqlCommand cmdCreateTable = new MySqlCommand("DROP TABLE IF EXISTS testbug25912", conn); cmdCreateTable.CommandTimeout = 0; cmdCreateTable.ExecuteNonQuery(); cmdCreateTable.CommandText = "CREATE TABLE testbug25912 (`t` time)"; cmdCreateTable.ExecuteNonQuery(); cmdCreateTable.CommandText = "INSERT INTO testbug25912 VALUES ('-07:24:00'),('-05:17:00'),('-06:09:00'),('-11:01:00'),('-13:00:00')"; cmdCreateTable.ExecuteNonQuery(); MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM testbug25912", conn); MySqlCommandBuilder cb = new MySqlCommandBuilder(da); DataTable dt = new DataTable(); da.Fill(dt); DisplayData(dt); Console.WriteLine("Done."); } private static void DisplayData(System.Data.DataTable table) { foreach (System.Data.DataRow row in table.Rows) { foreach (System.Data.DataColumn col in table.Columns) { Console.WriteLine("{0} = {1}", col.ColumnName, row[col]); } Console.WriteLine("============================"); } }
[30 Jan 2007 21:49]
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/19046
[30 Jan 2007 21: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/19047
[30 Jan 2007 21:59]
Reggie Burnett
Fixed in 5.0.4 and 1.0.9
[31 Jan 2007 16:21]
MC Brown
A note has been added to the 1.0.9 and 5.0.4 changelogs.