From: Date: February 13 2007 11:18pm Subject: Connector/NET commit: r588 - branches/1.0/TestSuite List-Archive: http://lists.mysql.com/commits/19808 X-Bug: 26139 Message-Id: <200702132218.l1DMI9Bc004491@bk-internal.mysql.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified: branches/1.0/TestSuite/StoredProcedure.cs Log: Bug #26139 MySqlCommand.LastInsertedId doesn't work for stored procedures Added a test case for this one but had to mark it as NotWorking since this is a server bug. Will enable the test case when the the server has this fixed. Modified: branches/1.0/TestSuite/StoredProcedure.cs =================================================================== --- branches/1.0/TestSuite/StoredProcedure.cs 2007-02-07 16:31:20 UTC (rev 587) +++ branches/1.0/TestSuite/StoredProcedure.cs 2007-02-13 22:18:09 UTC (rev 588) @@ -1093,5 +1093,27 @@ Assert.Fail(ex.Message); } } + + /// + /// Bug #26139 MySqlCommand.LastInsertedId doesn't work for stored procedures + /// Currently this is borked on the server so we are marking this as notworking + /// until the server has this fixed. + /// + [Category("NotWorking")] + [Test] + public void LastInsertId() + { + execSQL("DROP TABLE IF EXISTS test"); + execSQL("CREATE TABLE test (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(200))"); + execSQL("INSERT INTO test VALUES (NULL, 'Test1')"); + execSQL("CREATE PROCEDURE spTest() BEGIN " + + "INSERT INTO test VALUES (NULL, 'test'); END"); + + MySqlCommand cmd = new MySqlCommand("spTest", conn); + cmd.CommandTimeout = 0; + cmd.CommandType = CommandType.StoredProcedure; + cmd.ExecuteNonQuery(); + Assert.AreEqual(2, cmd.LastInsertedId); + } } }