Bug #16307 | @@Identity returning incorrect value | ||
---|---|---|---|
Submitted: | 9 Jan 2006 17:44 | Modified: | 7 Aug 2006 0:57 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 1.0.7 | OS: | Windows (Windows XP and Server2003) |
Assigned to: | Reggie Burnett | CPU Architecture: | Any |
[9 Jan 2006 17:44]
[ name withheld ]
[12 Jan 2006 21:02]
Vasily Kishkin
Thanks for the bug report. I was able to reproduce the bug. My test case is attached.
[19 May 2006 13:30]
Reggie Burnett
Neil Do you have to have a certain number of records in the table before it starts failing? I have been unable to reproduce this using the following NUnit test case. Perhaps you can modify the test case to show the problem? Also, do you still get the problem with later versions of 5.0? [Test] public void AutoIncrement() { execSQL("DROP TABLE IF EXISTS test"); execSQL("CREATE TABLE test (testID int(11) NOT NULL auto_increment, testName varchar(100) default '', " + "PRIMARY KEY (testID)) ENGINE=InnoDB DEFAULT CHARSET=latin1"); MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES (NULL, 'test')", conn); cmd.ExecuteNonQuery(); cmd.CommandText = "SELECT @@IDENTITY as 'Identity'"; MySqlDataReader reader = null; try { reader = cmd.ExecuteReader(); reader.Read(); int ident = Int32.Parse(reader.GetValue(0).ToString()); Assert.AreEqual(1, ident); } catch (Exception ex) { Assert.Fail(ex.Message); } finally { if (reader != null) reader.Close(); } }
[5 Aug 2006 23:45]
Reggie Burnett
Unable to repeat. Can you forward a chunk of code that reproduces the problem?
[7 Aug 2006 0:57]
[ name withheld ]
hello- thanks for your note. this goes back about 7 months and i have since migrated my code considerably, and reverted to 1.0.6, due to this issue. i no longer have any code samples to provide, but i believe the initial researcher at mysql did in fact reproduce this issue. sorry i can't be of further help. neil
[7 Aug 2006 1:40]
Reggie Burnett
Neil The person who reproduced it is no longer with MySQL and, contrary to his note on the bug report, he did not attach the test case to it. I've been unable to reproduce so I'm going to leave it cannot repeat. We are about to release 1.0.8 and have already released 5.0.0 alpha 1. If you are able, we would appreciate you testing these releases and letting us know if you still see any issues. Thanks Reggie