List:Commits« Previous MessageNext Message »
From:rburnett Date:November 2 2006 6:39pm
Subject:Connector/NET commit: r452 - in trunk: . TestSuite mysqlclient
View as plain text  
Modified:
   trunk/CHANGES
   trunk/MySQLClient.2005.sln
   trunk/TestSuite/DataAdapterTests.cs
   trunk/TestSuite/MySql.Data.Tests.2005.csproj
   trunk/TestSuite/PerfMonTests.cs
   trunk/TestSuite/Syntax.cs
   trunk/mysqlclient/MySqlStream.cs
   trunk/mysqlclient/NativeDriver.cs
Log:
MySqlStream, NativeDriver - Fixed LOAD DATA LOCAL INFILE

DataAdapterTests - Changed to reflect the fact that MySqlCommandBuilder no longer supports overriding autoincrement values

PerfMonTests - Removed code to create perfmon counters and categories as that code will not function under Vista UAC

Syntax - Whitespace clean up

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/CHANGES	2006-11-02 18:39:01 UTC (rev 452)
@@ -22,6 +22,7 @@
     Added Installer class to provide custom install type procedures such as modifying
          machine.config
     A nicer exception is displayed if you have added a parameter without the parameter marker.
+    Load Data Local InFile is working again         
          
 Version 5.0.1 (Beta)
 

Modified: trunk/MySQLClient.2005.sln
===================================================================
--- trunk/MySQLClient.2005.sln	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/MySQLClient.2005.sln	2006-11-02 18:39:01 UTC (rev 452)
@@ -2,7 +2,7 @@
 # Visual Studio 2005
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySql.Data.2005", "mysqlclient\MySql.Data.2005.csproj", "{E9DF5ED1-4CBD-4226-B931-9A51610AC14D}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySql.Data.Tests.2005", "TestSuite\MySql.Data.Tests.2005.csproj", "{92CB29DF-61DE-4277-8DC6-D3587C7311EE}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySql.Data.Tests.2005", "TestSuite\MySql.Data.Tests.2005.csproj", "{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,12 +20,12 @@
 		{E9DF5ED1-4CBD-4226-B931-9A51610AC14D}.Release|Any CPU.Build.0 = Release|Any CPU
 		{E9DF5ED1-4CBD-4226-B931-9A51610AC14D}.Release|x86.ActiveCfg = Release|x86
 		{E9DF5ED1-4CBD-4226-B931-9A51610AC14D}.Release|x86.Build.0 = Release|x86
-		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Release|Any CPU.Build.0 = Release|Any CPU
-		{92CB29DF-61DE-4277-8DC6-D3587C7311EE}.Release|x86.ActiveCfg = Release|Any CPU
+		{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: trunk/TestSuite/DataAdapterTests.cs
===================================================================
--- trunk/TestSuite/DataAdapterTests.cs	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/TestSuite/DataAdapterTests.cs	2006-11-02 18:39:01 UTC (rev 452)
@@ -355,7 +355,7 @@
 		/// Bug #8509 - MySqlDataAdapter.FillSchema does not interpret unsigned integer
 		/// </summary>
 		[Test]
-		public void AutoIncrementColumns() 
+		public void AutoIncrementColumns()
 		{
 			execSQL("DROP TABLE IF EXISTS test");
 			execSQL("CREATE TABLE test (id int(10) unsigned NOT NULL auto_increment primary key)");
@@ -366,17 +366,10 @@
 			DataSet ds = new DataSet();
 			da.Fill(ds);
 			Assert.AreEqual(1, ds.Tables[0].Rows[0]["id"]);
-			ds.Tables[0].Rows[0]["id"] = 2;
 			DataRow row = ds.Tables[0].NewRow();
-			row["id"] = 4;
 			ds.Tables[0].Rows.Add(row);
 
-			// add a null id.  This should be auto'ed to 5
-			row = ds.Tables[0].NewRow();
-			row["id"] = DBNull.Value;
-			ds.Tables[0].Rows.Add(row);
-
-			try 
+			try
 			{
 				da.Update(ds);
 			}
@@ -387,9 +380,8 @@
 
 			ds.Clear();
 			da.Fill(ds);
-			Assert.AreEqual(2, ds.Tables[0].Rows[0]["id"]);
-			Assert.AreEqual(4, ds.Tables[0].Rows[1]["id"]);
-			Assert.AreEqual(5, ds.Tables[0].Rows[2]["id"]);
+			Assert.AreEqual(1, ds.Tables[0].Rows[0]["id"]);
+			Assert.AreEqual(2, ds.Tables[0].Rows[1]["id"]);
 		}
 
 		/// <summary>

Modified: trunk/TestSuite/MySql.Data.Tests.2005.csproj
===================================================================
--- trunk/TestSuite/MySql.Data.Tests.2005.csproj	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/TestSuite/MySql.Data.Tests.2005.csproj	2006-11-02 18:39:01 UTC (rev 452)
@@ -1,167 +1,79 @@
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectType>Local</ProjectType>
-    <ProductVersion>8.0.50727</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{92CB29DF-61DE-4277-8DC6-D3587C7311EE}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ApplicationIcon>
-    </ApplicationIcon>
-    <AssemblyKeyContainerName>
-    </AssemblyKeyContainerName>
-    <AssemblyName>MySql.Data.Tests</AssemblyName>
-    <AssemblyOriginatorKeyFile>
-    </AssemblyOriginatorKeyFile>
-    <DefaultClientScript>JScript</DefaultClientScript>
-    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
-    <DefaultTargetSchema>IE50</DefaultTargetSchema>
-    <DelaySign>false</DelaySign>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{F29E5B3D-7F76-4CF9-BF5E-8E3A1377B1E4}</ProjectGuid>
     <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>MySql.Data.MySqlClient.Tests</RootNamespace>
-    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
-    <StartupObject>
-    </StartupObject>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <UpgradeBackupLocation>
-    </UpgradeBackupLocation>
+    <AssemblyName>MySql.Data.Tests</AssemblyName>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <OutputPath>bin\net-2.0\Debug\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE;DEBUG;NET20</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
     <DebugSymbols>true</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
+    <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;NET20</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <UseVSHostingProcess>false</UseVSHostingProcess>
-    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisRules>
+    </CodeAnalysisRules>
+    <RunCodeAnalysis>false</RunCodeAnalysis>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <OutputPath>bin\net-2.0\Release\</OutputPath>
-    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
-    <BaseAddress>285212672</BaseAddress>
-    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
-    <ConfigurationOverrideFile>
-    </ConfigurationOverrideFile>
-    <DefineConstants>TRACE</DefineConstants>
-    <DocumentationFile>
-    </DocumentationFile>
-    <DebugSymbols>false</DebugSymbols>
-    <FileAlignment>4096</FileAlignment>
-    <NoStdLib>false</NoStdLib>
-    <NoWarn>
-    </NoWarn>
+    <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <RegisterForComInterop>false</RegisterForComInterop>
-    <RemoveIntegerChecks>false</RemoveIntegerChecks>
-    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE;NET20</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
-    <Reference Include="System">
-      <Name>System</Name>
-    </Reference>
-    <Reference Include="System.Data">
-      <Name>System.Data</Name>
-    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
     <Reference Include="System.Transactions" />
-    <Reference Include="System.XML" />
+    <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="AssemblyInfo.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="BaseTest.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="BlobTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="CharacterSetTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="CommandBuilderTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="CommandTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ConnectionStringBuilder.cs" />
-    <Compile Include="ConnectionTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="AsyncTests.cs" />
-    <Compile Include="InterfaceTests.cs" />
-    <Compile Include="GetSchemaTests.cs" />
+    <Compile Include="BaseTest.cs" />
+    <Compile Include="BlobTests.cs" />
+    <Compile Include="CharacterSetTests.cs" />
+    <Compile Include="CommandBuilderTests.cs" />
+    <Compile Include="CommandTests.cs" />
+    <Compile Include="ConnectionStringBuilder.cs" />
+    <Compile Include="ConnectionTests.cs" />
+    <Compile Include="CultureTests.cs" />
+    <Compile Include="CursorTests.cs" />
+    <Compile Include="DataAdapterTests.cs" />
     <Compile Include="DataReaderTests.cs" />
+    <Compile Include="DataTypeTests.cs" />
+    <Compile Include="DateTimeTests.cs" />
+    <Compile Include="EventTests.cs" />
+    <Compile Include="ExceptionTests.cs" />
+    <Compile Include="GetSchemaTests.cs" />
+    <Compile Include="InterfaceTests.cs" />
+    <Compile Include="LanguageTests.cs" />
     <Compile Include="MicroPerfTests.cs" />
-    <Compile Include="CultureTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="CursorTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="DataAdapterTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="DataTypeTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="DateTimeTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ExceptionTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="LanguageTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="ParameterTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
+    <Compile Include="MySqlHelperTests.cs" />
+    <Compile Include="ParameterTests.cs" />
     <Compile Include="PerfMonTests.cs" />
-    <Compile Include="PoolingTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="PreparedStatements.cs">
-      <SubType>Code</SubType>
-    </Compile>
+    <Compile Include="PoolingTests.cs" />
+    <Compile Include="PreparedStatements.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SimpleTransactions.cs" />
-    <Compile Include="StoredProcedure.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="StressTests.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Syntax.cs">
-      <SubType>Code</SubType>
-    </Compile>
+    <Compile Include="StoredProcedure.cs" />
+    <Compile Include="StressTests.cs" />
+    <Compile Include="Syntax.cs" />
+    <Compile Include="Syntax2.cs" />
     <Compile Include="Threading.cs" />
     <Compile Include="TimeoutAndCancel.cs" />
-    <Compile Include="Transactions.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="UsageAdvisor.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Utils.cs">
-      <SubType>Code</SubType>
-    </Compile>
+    <Compile Include="Transactions.cs" />
+    <Compile Include="UsageAdvisor.cs" />
+    <Compile Include="Utils.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\mysqlclient\MySql.Data.2005.csproj">
@@ -170,10 +82,11 @@
     </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>
-    </PreBuildEvent>
-    <PostBuildEvent>
-    </PostBuildEvent>
-  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
 </Project>
\ No newline at end of file

Modified: trunk/TestSuite/PerfMonTests.cs
===================================================================
--- trunk/TestSuite/PerfMonTests.cs	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/TestSuite/PerfMonTests.cs	2006-11-02 18:39:01 UTC (rev 452)
@@ -38,77 +38,48 @@
 		[TestFixtureSetUp]
 		public void FixtureSetup()
 		{
-            CounterCreationDataCollection ccd = new CounterCreationDataCollection();
-            string categoryName = ".NET Data Provider for MySQL";
-            try
-            {
-                if (PerformanceCounterCategory.Exists(categoryName))
-                    PerformanceCounterCategory.Delete(categoryName);
-                CounterCreationData procHardQuery = new CounterCreationData(
-                    "HardProcedureQueries", "Number of stored procedure metadata queries that are sent to MySQL",
-                    PerformanceCounterType.NumberOfItems32);
-                ccd.Add(procHardQuery);
-                CounterCreationData procSoftQuery = new CounterCreationData(
-                    "SoftProcedureQueries", "Number of stored procedure metadata queries that are handled by cache",
-                    PerformanceCounterType.NumberOfItems32);
-                ccd.Add(procSoftQuery);
-#if NET20
-                PerformanceCounterCategory.Create(categoryName,
-                    "Performance counters for the .NET provider for MySQL", 
-                    PerformanceCounterCategoryType.SingleInstance,
-                    ccd);
-#else
-                PerformanceCounterCategory.Create(categoryName,
-                    "Performance counters for the .NET provider for MySQL", 
-                    ccd);
-#endif
-            }
-            catch (Exception ex)
-            {
-                Assert.Fail(ex.Message);
-            }
-            csAdditions = ";pooling=false;use performance monitor=true";
+			csAdditions = ";pooling=false;use performance monitor=true";
 			Open();
 			execSQL("DROP TABLE IF EXISTS Test; CREATE TABLE Test (id INT, name VARCHAR(100))");
 		}
 
 		[TestFixtureTearDown]
-		public void TestFixtureTearDown() 
+		public void TestFixtureTearDown()
 		{
 			Close();
 		}
 
-        [Test]
-        [Category("5.0")]
-        public void ProcedureFromCache()
-        {
-            execSQL("DROP PROCEDURE IF EXISTS spTest");
-            execSQL("CREATE PROCEDURE spTest(id int) BEGIN END");
+		[Test]
+		[Category("5.0")]
+		public void ProcedureFromCache()
+		{
+			execSQL("DROP PROCEDURE IF EXISTS spTest");
+			execSQL("CREATE PROCEDURE spTest(id int) BEGIN END");
 
-            PerformanceCounter hardQuery = new PerformanceCounter(
-                ".NET Data Provider for MySQL", "HardProcedureQueries", true);
-            PerformanceCounter softQuery = new PerformanceCounter(
-                ".NET Data Provider for MySQL", "SoftProcedureQueries", true);
-            long hardCount = hardQuery.RawValue;
-            long softCount = softQuery.RawValue;
+			PerformanceCounter hardQuery = new PerformanceCounter(
+				 ".NET Data Provider for MySQL", "HardProcedureQueries", true);
+			PerformanceCounter softQuery = new PerformanceCounter(
+				 ".NET Data Provider for MySQL", "SoftProcedureQueries", true);
+			long hardCount = hardQuery.RawValue;
+			long softCount = softQuery.RawValue;
 
-            MySqlCommand cmd = new MySqlCommand("spTest", conn);
-            cmd.CommandType = CommandType.StoredProcedure;
-            cmd.Parameters.Add("?id", 1);
-            cmd.ExecuteScalar();
+			MySqlCommand cmd = new MySqlCommand("spTest", conn);
+			cmd.CommandType = CommandType.StoredProcedure;
+			cmd.Parameters.Add("?id", 1);
+			cmd.ExecuteScalar();
 
-            Assert.AreEqual(hardCount + 1, hardQuery.RawValue);
-            Assert.AreEqual(softCount, softQuery.RawValue);
-            hardCount = hardQuery.RawValue;
+			Assert.AreEqual(hardCount + 1, hardQuery.RawValue);
+			Assert.AreEqual(softCount, softQuery.RawValue);
+			hardCount = hardQuery.RawValue;
 
-            MySqlCommand cmd2 = new MySqlCommand("spTest", conn);
-            cmd2.CommandType = CommandType.StoredProcedure;
-            cmd2.Parameters.Add("?id", 1);
-            cmd2.ExecuteScalar();
+			MySqlCommand cmd2 = new MySqlCommand("spTest", conn);
+			cmd2.CommandType = CommandType.StoredProcedure;
+			cmd2.Parameters.Add("?id", 1);
+			cmd2.ExecuteScalar();
 
-            Assert.AreEqual(hardCount, hardQuery.RawValue);
-            Assert.AreEqual(softCount+1, softQuery.RawValue);
-        }
+			Assert.AreEqual(hardCount, hardQuery.RawValue);
+			Assert.AreEqual(softCount + 1, softQuery.RawValue);
+		}
 
 	}
 }

Modified: trunk/TestSuite/Syntax.cs
===================================================================
--- trunk/TestSuite/Syntax.cs	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/TestSuite/Syntax.cs	2006-11-02 18:39:01 UTC (rev 452)
@@ -62,12 +62,16 @@
 
 		[Test]
 		[Category("4.1")]
-		public void ProblemCharsInSQL()
+		public void ProblemCharsInSQLUTF8()
 		{
 			execSQL("DROP TABLE IF EXISTS Test");
-			execSQL("CREATE TABLE Test (id INT NOT NULL, name VARCHAR(250), mt MEDIUMTEXT, PRIMARY KEY(id)) CHAR SET utf8");
+			execSQL("CREATE TABLE Test (id INT NOT NULL, name VARCHAR(250), mt MEDIUMTEXT, " +
+					  "PRIMARY KEY(id)) CHAR SET utf8");
 
-			MySqlCommand cmd = new MySqlCommand( "INSERT INTO Test VALUES (?id, ?text, ?mt)", conn);
+			MySqlConnection c = new MySqlConnection(GetConnectionString(true) + ";charset=utf8");
+			c.Open();
+
+			MySqlCommand cmd = new MySqlCommand("INSERT INTO Test VALUES (?id, ?text, ?mt)", c);
 			cmd.Parameters.Add("?id", 1);
 			cmd.Parameters.Add("?text", "This is my;test ? string 			cmd.Parameters.Add("?mt", "My MT string: @@ -75,28 +79,60 @@
 
 			cmd.CommandText = "SELECT * FROM Test";
 			MySqlDataReader reader = null;
-			try 
+			try
 			{
 				reader = cmd.ExecuteReader();
 				Assert.IsTrue(reader.Read());
 				Assert.AreEqual(1, reader.GetInt32(0));
-				if (Is40)
-					Assert.AreEqual("This is my;test ? string-'''\"\".", reader.GetString(1));
-				else
-					Assert.AreEqual("This is my;test ? string+				Assert.AreEqual("This is my;test ? string 				Assert.AreEqual("My MT string:  			}
-			catch (Exception ex) 
+			catch (Exception ex)
 			{
 				Assert.Fail(ex.Message);
 			}
-			finally 
+			finally
 			{
 				if (reader != null) reader.Close();
+				if (c != null) c.Close();
 			}
 		}
 
+
 		[Test]
+		public void ProblemCharsInSQL()
+		{
+			execSQL("DROP TABLE IF EXISTS Test");
+			execSQL("CREATE TABLE Test (id INT NOT NULL, name VARCHAR(250), mt MEDIUMTEXT, " +
+					  "PRIMARY KEY(id))");
+
+			MySqlCommand cmd = new MySqlCommand("INSERT INTO Test VALUES (?id, ?text, ?mt)", conn);
+			cmd.Parameters.Add("?id", 1);
+			cmd.Parameters.Add("?text", "This is my;test ? string-'''\"\".");
+			cmd.Parameters.Add("?mt", "My MT string: +			cmd.ExecuteNonQuery();
+
+			cmd.CommandText = "SELECT * FROM Test";
+			MySqlDataReader reader = null;
+			try
+			{
+				reader = cmd.ExecuteReader();
+				Assert.IsTrue(reader.Read());
+				Assert.AreEqual(1, reader.GetInt32(0));
+				Assert.AreEqual("This is my;test ? string-'''\"\".", reader.GetString(1));
+				Assert.AreEqual("My MT string: +			}
+			catch (Exception ex)
+			{
+				Assert.Fail(ex.Message);
+			}
+			finally
+			{
+				if (reader != null) reader.Close();
+			}
+		}
+
+		[Test]
 		public void LoadDataLocalInfile() 
 		{
 			execSQL("set @@global.max_allowed_packet=250000000");
@@ -107,7 +143,7 @@
 
 			string path = Path.GetTempFileName();
 			StreamWriter sw = new StreamWriter(path);
-			for (int i=0; i < 2000000; i++) 
+			for (int i = 0; i < 2000000; i++) 
 				sw.WriteLine(i + ",'Test'");
 			sw.Flush();
 			sw.Close();

Modified: trunk/mysqlclient/MySqlStream.cs
===================================================================
--- trunk/mysqlclient/MySqlStream.cs	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/mysqlclient/MySqlStream.cs	2006-11-02 18:39:01 UTC (rev 452)
@@ -238,6 +238,14 @@
 			outStream.WriteByte((byte)sequenceByte++);
 		}
 
+		public void SendEmptyPacket()
+		{
+			outLength = 0;
+			outPos = 0;
+			WriteHeader();
+			outStream.Flush();
+		}
+
 		#endregion
 
 		#region Byte methods

Modified: trunk/mysqlclient/NativeDriver.cs
===================================================================
--- trunk/mysqlclient/NativeDriver.cs	2006-11-02 15:07:21 UTC (rev 451)
+++ trunk/mysqlclient/NativeDriver.cs	2006-11-02 18:39:01 UTC (rev 452)
@@ -437,10 +437,6 @@
 				return -1;
 
 			lastInsertId = -1;
-			// the code to read last packet will set these server status vars 
-			// again if necessary.
-			serverStatus &= ~(ServerStatusFlags.AnotherQuery |
-					  ServerStatusFlags.MoreResults);
 			stream.OpenPacket();
 
 			long fieldCount = stream.ReadFieldLength();
@@ -455,6 +451,10 @@
 				return ReadResult(ref affectedRows, ref lastInsertId);
 			}
 
+			// the code to read last packet will set these server status vars 
+			// again if necessary.
+			serverStatus &= ~(ServerStatusFlags.AnotherQuery |
+					  ServerStatusFlags.MoreResults);
 			affectedRows = (ulong)stream.ReadFieldLength();
 			lastInsertId = (long)stream.ReadFieldLength();
 			if (version.isAtLeast(4, 1, 0))
@@ -482,7 +482,7 @@
 			try
 			{
 				fs = new FileStream(filename, FileMode.Open);
-				stream.StartOutput((ulong)fs.Length, true);
+				stream.StartOutput((ulong)fs.Length, false);
 
 				long len = fs.Length;
 				while (len > 0)
@@ -491,11 +491,9 @@
 					stream.Write(buffer, 0, count);
 					len -= count;
 				}
-				stream.Flush();
 
 				// write the terminating packet
-				stream.StartOutput(3, false);
-				stream.WriteInteger(0, 3);
+				stream.SendEmptyPacket();
 				stream.Flush();
 			}
 			catch (Exception ex)

Thread
Connector/NET commit: r452 - in trunk: . TestSuite mysqlclientrburnett2 Nov