List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:September 16 2009 8:04pm
Subject:bzr commit into connector-net-6.0 branch (reggie.burnett:767)
View as plain text  
#At file:///D:/bzr-connector-net/6.0/ based on revid:reggie@mobilecore-20090915003304-btvclrxgedpg5xug

  767 Reggie Burnett	2009-09-16
      - we are now throwing an InvalidOperationException is the TableDirect command type is used

    modified:
      CHANGES
      MySql.Data/Provider/MySql.Data.csproj
      MySql.Data/Provider/Properties/Resources.Designer.cs
      MySql.Data/Provider/Properties/Resources.resx
      MySql.Data/Provider/Source/command.cs
      MySql.Data/Tests/Source/CommandTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2009-09-15 00:33:04 +0000
+++ b/CHANGES	2009-09-16 20:04:48 +0000
@@ -38,6 +38,7 @@
 - fixed problem with non-IS column parsing that caused data type and column type to be equal when
   parsing set and enum columns
 - fixed mono compilation problem (bug #47048)
+- we are now throwing an InvalidOperationException is the TableDirect command type is used    
     
 Version 6.0.4
 - fixed regression where using stored procs with datasets (bug #44460)

=== modified file 'MySql.Data/Provider/MySql.Data.csproj'
--- a/MySql.Data/Provider/MySql.Data.csproj	2009-09-15 00:20:38 +0000
+++ b/MySql.Data/Provider/MySql.Data.csproj	2009-09-16 20:04:48 +0000
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
   <PropertyGroup>
     <ProjectType>Local</ProjectType>
@@ -116,6 +116,11 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
     <Compile Include="Source\CharSetMap.cs" />
     <Compile Include="Source\command.cs" />
     <Compile Include="Source\CommandBuilder.cs" />
@@ -195,9 +200,6 @@
     <Compile Include="Source\zlib\ZOutputStream.cs" />
     <Compile Include="Source\zlib\ZStream.cs" />
     <Compile Include="Source\zlib\ZStreamException.cs" />
-    <Compile Include="Properties\Resources.Designer.cs">
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
     <Compile Include="Properties\VersionInfo.cs" />
     <Compile Include="Source\common\Cache.cs" />
     <Compile Include="Source\common\MySqlTokenizer.cs" />
@@ -211,6 +213,7 @@
     <EmbeddedResource Include="Properties\Resources.resx">
       <SubType>Designer</SubType>
       <Generator>PublicResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
     <Content Include="Source\docs\MySqlCommand.xml" />
     <Content Include="Source\docs\MySqlCommandBuilder.xml" />

=== modified file 'MySql.Data/Provider/Properties/Resources.Designer.cs'
--- a/MySql.Data/Provider/Properties/Resources.Designer.cs	2009-07-28 13:10:23 +0000
+++ b/MySql.Data/Provider/Properties/Resources.Designer.cs	2009-09-16 20:04:48 +0000
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.3053
+//     Runtime Version:2.0.50727.4927
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -693,6 +693,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to TableDirect command type is not supported..
+        /// </summary>
+        public static string TableDirectNotSupported {
+            get {
+                return ResourceManager.GetString("TableDirectNotSupported", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding..
         /// </summary>
         public static string Timeout {

=== modified file 'MySql.Data/Provider/Properties/Resources.resx'
--- a/MySql.Data/Provider/Properties/Resources.resx	2009-07-13 02:34:29 +0000
+++ b/MySql.Data/Provider/Properties/Resources.resx	2009-09-16 20:04:48 +0000
@@ -60,51 +60,63 @@
             : and then encoded with base64 encoding.
     -->
   <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
     <xsd:element name="root" msdata:IsDataSet="true">
       <xsd:complexType>
         <xsd:choice maxOccurs="unbounded">
           <xsd:element name="metadata">
             <xsd:complexType>
               <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0"/>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
               </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string"/>
-              <xsd:attribute name="type" type="xsd:string"/>
-              <xsd:attribute name="mimetype" type="xsd:string"/>
-              <xsd:attribute ref="xml:space"/>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="assembly">
             <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string"/>
-              <xsd:attribute name="name" type="xsd:string"/>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="data">
             <xsd:complexType>
               <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
-              <xsd:attribute ref="xml:space"/>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
             </xsd:complexType>
           </xsd:element>
           <xsd:element name="resheader">
             <xsd:complexType>
               <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required"/>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
             </xsd:complexType>
           </xsd:element>
         </xsd:choice>
       </xsd:complexType>
     </xsd:element>
   </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
   <data name="BadVersionFormat" xml:space="preserve">
     <value>Version string not in acceptable format</value>
   </data>
@@ -327,7 +339,9 @@
   <data name="FatalErrorReadingResult" xml:space="preserve">
     <value>Fatal error encountered attempting to read the resultset.</value>
   </data>
-  <data name="RoutineNotFound" xml:space="preserve">    <value>Routine '{0}' cannot be found. Either check the spelling or make sure you have sufficient rights to execute the routine.</value>  </data>
+  <data name="RoutineNotFound" xml:space="preserve">
+    <value>Routine '{0}' cannot be found. Either check the spelling or make sure you have sufficient rights to execute the routine.</value>
+  </data>
   <data name="ParameterNotFoundDuringPrepare" xml:space="preserve">
     <value>Parameter '{0}' was not found during prepare.</value>
   </data>
@@ -349,22 +363,13 @@
   <data name="TimeoutExpiredNullObject" xml:space="preserve">
     <value>Timeout expired but command object was null.  This should not happen.</value>
   </data>
-  <data name="UnableToEnumerateUDF" xml:space="preserve">    
-    <value>An error occured attempting to enumerate the user-defined functions.  Do you have SELECT privileges on the mysql.func table?</value>  
-  </data>
-  <data name="DataNotInSupportedFormat" xml:space="preserve">    
-    <value>The given value was not in a supported format.</value>  
-  </data>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
+  <data name="UnableToEnumerateUDF" xml:space="preserve">
+    <value>An error occured attempting to enumerate the user-defined functions.  Do you have SELECT privileges on the mysql.func table?</value>
+  </data>
+  <data name="DataNotInSupportedFormat" xml:space="preserve">
+    <value>The given value was not in a supported format.</value>
+  </data>
+  <data name="TableDirectNotSupported" xml:space="preserve">
+    <value>TableDirect command type is not supported.</value>
+  </data>
+</root>
\ No newline at end of file

=== modified file 'MySql.Data/Provider/Source/command.cs'
--- a/MySql.Data/Provider/Source/command.cs	2009-09-01 03:54:56 +0000
+++ b/MySql.Data/Provider/Source/command.cs	2009-09-16 20:04:48 +0000
@@ -296,6 +296,9 @@
 			if (connection.Reader != null)
 				throw new MySqlException("There is already an open DataReader associated with this Connection which must be closed first.");
 
+            if (CommandType == CommandType.TableDirect)
+                throw new InvalidOperationException(Resources.TableDirectNotSupported);
+
 			if (CommandType == CommandType.StoredProcedure && !connection.driver.Version.isAtLeast(5, 0, 0))
 				throw new MySqlException("Stored procedures are not supported on this version of MySQL");
 		}

=== modified file 'MySql.Data/Tests/Source/CommandTests.cs'
--- a/MySql.Data/Tests/Source/CommandTests.cs	2009-07-12 16:21:45 +0000
+++ b/MySql.Data/Tests/Source/CommandTests.cs	2009-09-16 20:04:48 +0000
@@ -421,6 +421,21 @@
                 cmd.ExecuteScalar();
             }
         }
+
+        [Test]
+        public void TableCommandType()
+        {
+            MySqlCommand cmd = new MySqlCommand("Mytable", conn);
+            cmd.CommandType = CommandType.TableDirect;
+            try
+            {
+                cmd.ExecuteReader();
+                Assert.Fail("This should have failed");
+            }
+            catch (InvalidOperationException ex)
+            {
+            }
+        }
     }
 
 

Attachment: [text/bzr-bundle] bzr/reggie.burnett@sun.com-20090916200448-ozmcas6oute8l0kb.bundle
Thread
bzr commit into connector-net-6.0 branch (reggie.burnett:767)Reggie Burnett16 Sep