List:Commits« Previous MessageNext Message »
From:rburnett Date:February 13 2007 11:19pm
Subject:Connector/NET commit: r589 - branches/5.0/TestSuite
View as plain text  
Modified:
   branches/5.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/5.0/TestSuite/StoredProcedure.cs
===================================================================
--- branches/5.0/TestSuite/StoredProcedure.cs	2007-02-13 22:18:09 UTC (rev 588)
+++ branches/5.0/TestSuite/StoredProcedure.cs	2007-02-13 22:19:00 UTC (rev 589)
@@ -1104,5 +1104,26 @@
             }
         }
 
+        /// <summary>
+        /// 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.
+        /// </summary>
+        [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);
+        }
 	}
 }

Thread
Connector/NET commit: r589 - branches/5.0/TestSuiterburnett13 Feb