MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:rburnett Date:August 30 2007 10:10pm
Subject:Connector/NET commit: r997 - branches/5.1/TestSuite/Source
View as plain text  
Modified:
   branches/5.1/TestSuite/Source/BaseTest.cs
   branches/5.1/TestSuite/Source/BlobTests.cs
   branches/5.1/TestSuite/Source/CommandTests.cs
   branches/5.1/TestSuite/Source/PreparedStatements.cs
   branches/5.1/TestSuite/Source/StoredProcedure.cs
   branches/5.1/TestSuite/Source/Syntax.cs
Log:
fixed some test suite problems found when run against a linux based db

Modified: branches/5.1/TestSuite/Source/BaseTest.cs
===================================================================
--- branches/5.1/TestSuite/Source/BaseTest.cs	2007-08-30 21:11:28 UTC (rev 996)
+++ branches/5.1/TestSuite/Source/BaseTest.cs	2007-08-30 22:10:51 UTC (rev 997)
@@ -59,7 +59,7 @@
             rootPassword = "";
 
 #if NET20
-            string host = ConfigurationManager.AppSettings["host"];
+            host = ConfigurationManager.AppSettings["host"];
             string strPort = ConfigurationManager.AppSettings["port"];
             string pipeName = ConfigurationManager.AppSettings["pipename"];
             string memoryName = ConfigurationManager.AppSettings["memory_name"];

Modified: branches/5.1/TestSuite/Source/BlobTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/BlobTests.cs	2007-08-30 21:11:28 UTC (rev 996)
+++ branches/5.1/TestSuite/Source/BlobTests.cs	2007-08-30 22:10:51 UTC (rev 997)
@@ -48,7 +48,7 @@
 			byte[] dataIn = Utils.CreateBlob(lenIn);
 
 
-			MySqlCommand cmd2 = new MySqlCommand("SELECT * FROM test", conn);
+			MySqlCommand cmd2 = new MySqlCommand("SELECT * FROM Test", conn);
 			MySqlDataReader reader2 = cmd2.ExecuteReader();
 			reader2.Read();
 			reader2.Close();

Modified: branches/5.1/TestSuite/Source/CommandTests.cs
===================================================================
--- branches/5.1/TestSuite/Source/CommandTests.cs	2007-08-30 21:11:28 UTC (rev 996)
+++ branches/5.1/TestSuite/Source/CommandTests.cs	2007-08-30 22:10:51 UTC (rev 997)
@@ -226,15 +226,15 @@
 		{
             if (Version < new Version(4, 1)) return;
 
-			execSQL("TRUNCATE TABLE test");
-			MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES(1, ?str)", conn);
+			execSQL("TRUNCATE TABLE Test");
+			MySqlCommand cmd = new MySqlCommand("INSERT INTO Test VALUES(1, ?str)", conn);
 			cmd.Parameters.Add("?str", MySqlDbType.VarChar);
 			cmd.Prepare();
 
 			cmd.Parameters[0].Value = null;
 			cmd.ExecuteNonQuery();
 
-			cmd.CommandText = "SELECT * FROM test";
+			cmd.CommandText = "SELECT * FROM Test";
 			MySqlDataReader reader = null;
 			try 
 			{
@@ -260,13 +260,13 @@
 		{
             if (Version < new Version(4, 1)) return;
 
-            execSQL("TRUNCATE TABLE test");
-			MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES(1, 'Test')", conn);
+            execSQL("TRUNCATE TABLE Test");
+			MySqlCommand cmd = new MySqlCommand("INSERT INTO Test VALUES(1, 'Test')", conn);
 			cmd.Prepare();
 			MySqlDataReader reader = cmd.ExecuteReader();
 			reader.Close();
 
-			cmd.CommandText = "SELECT * FROM test";
+			cmd.CommandText = "SELECT * FROM Test";
 			reader = null;
 			try 
 			{

Modified: branches/5.1/TestSuite/Source/PreparedStatements.cs
===================================================================
--- branches/5.1/TestSuite/Source/PreparedStatements.cs	2007-08-30 21:11:28 UTC (rev 996)
+++ branches/5.1/TestSuite/Source/PreparedStatements.cs	2007-08-30 22:10:51 UTC (rev 997)
@@ -598,7 +598,7 @@
             execSQL("INSERT INTO Test VALUES ('128', 'name2')");
             execSQL("INSERT INTO Test VALUES ('255', 'name3')");
 
-            string sql = " SELECT count(*) FROM TEST WHERE ID = ?id";
+            string sql = " SELECT count(*) FROM Test WHERE ID = ?id";
 
             MySqlCommand command = new MySqlCommand();
             command.CommandText = sql;

Modified: branches/5.1/TestSuite/Source/StoredProcedure.cs
===================================================================
--- branches/5.1/TestSuite/Source/StoredProcedure.cs	2007-08-30 21:11:28 UTC (rev 996)
+++ branches/5.1/TestSuite/Source/StoredProcedure.cs	2007-08-30 22:10:51 UTC (rev 997)
@@ -1330,31 +1330,15 @@
         [Test]
         public void CatalogWithHyphens()
         {
-            string dbName = System.IO.Path.GetFileNameWithoutExtension(
-                System.IO.Path.GetTempFileName()) + "-x";
-            try
-            {
-                // create the database
-                suExecSQL(String.Format("CREATE DATABASE `{0}`", dbName));
-                suExecSQL(String.Format("GRANT ALL ON `{0}`.* to 'test'@'localhost' identified by 'test'",
-                    dbName));
-                suExecSQL("FLUSH PRIVILEGES");
+            // make sure this test is valid
+            Assert.IsTrue(database0.IndexOf('-') != -1);
 
-                string connStr = GetConnectionString(false) + ";database=" + dbName;
-                MySqlConnection c = new MySqlConnection(connStr);
-                c.Open();
+            MySqlCommand cmd = new MySqlCommand("CREATE PROCEDURE spTest() BEGIN SELECT 1; END", conn);
+            cmd.ExecuteNonQuery();
 
-                MySqlCommand cmd = new MySqlCommand("CREATE PROCEDURE spTest() BEGIN SELECT 1; END", c);
-                cmd.ExecuteNonQuery();
-
-                cmd.CommandText = "spTest";
-                cmd.CommandType = CommandType.StoredProcedure;
-                Assert.AreEqual(1, cmd.ExecuteScalar());
-            }
-            finally
-            {
-                suExecSQL(String.Format("DROP DATABASE `{0}`", dbName));
-            }
+            cmd.CommandText = "spTest";
+            cmd.CommandType = CommandType.StoredProcedure;
+            Assert.AreEqual(1, cmd.ExecuteScalar());
         }
 	}
 }

Modified: branches/5.1/TestSuite/Source/Syntax.cs
===================================================================
--- branches/5.1/TestSuite/Source/Syntax.cs	2007-08-30 21:11:28 UTC (rev 996)
+++ branches/5.1/TestSuite/Source/Syntax.cs	2007-08-30 22:10:51 UTC (rev 997)
@@ -482,6 +482,8 @@
                 suExecSQL(String.Format("CREATE DATABASE `{0}`", dbName));
                 suExecSQL(String.Format("GRANT ALL ON `{0}`.* to 'test'@'localhost' identified by 'test'",
                     dbName));
+                suExecSQL(String.Format("GRANT ALL ON `{0}`.* to 'test'@'%' identified by 'test'",
+                    dbName));
                 suExecSQL("FLUSH PRIVILEGES");
 
                 string connStr = GetConnectionString(false) + ";database=" + dbName;

Thread
Connector/NET commit: r997 - branches/5.1/TestSuite/Sourcerburnett31 Aug