MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:November 3 2009 4:18pm
Subject:bzr commit into connector-net-trunk branch (reggie.burnett:793)
Bug#48417
View as plain text  
#At file:///C:/bzr-connector-net/trunk/ based on revid:reggie.burnett@stripped

  793 Reggie Burnett	2009-11-03 [merge]
      A few changes to include a test to verify bug #48417 has been fixed.

    modified:
      MySql.Data.Entity/Tests/DataTypeTests.cs
      MySql.Data.Entity/Tests/Properties/schema.sql
      MySql.Data.Entity/Tests/TestModel.Designer.cs
      MySql.Data.Entity/Tests/TestModel.csdl
      MySql.Data.Entity/Tests/TestModel.msl
      MySql.Data.Entity/Tests/TestModel.ssdl
=== modified file 'MySql.Data.Entity/Tests/DataTypeTests.cs'
=== modified file 'MySql.Data.Entity/Tests/DataTypeTests.cs'
--- a/MySql.Data.Entity/Tests/DataTypeTests.cs	2009-09-01 00:49:03 +0000
+++ b/MySql.Data.Entity/Tests/DataTypeTests.cs	2009-11-03 16:10:05 +0000
@@ -129,5 +129,20 @@
                 Assert.AreEqual(now, dt);
             }
         }
+
+        /// <summary>
+        /// Bug #48417	Invalid cast from 'System.String' to 'System.Guid'
+        /// </summary>
+        [Test]
+        public void GuidType()
+        {
+            using (testEntities context = new testEntities())
+            {
+                DataTypeTest dtt = context.DataTypeTests.First();
+                string guidAsChar = dtt.idAsChar;
+                Assert.AreEqual(guidAsChar, dtt.id.ToString());
+                Assert.AreEqual(guidAsChar, dtt.id2.ToString());
+            }
+        }
     }
 }
\ No newline at end of file

=== modified file 'MySql.Data.Entity/Tests/Properties/schema.sql'
--- a/MySql.Data.Entity/Tests/Properties/schema.sql	2009-08-10 21:17:20 +0000
+++ b/MySql.Data.Entity/Tests/Properties/schema.sql	2009-11-03 16:10:05 +0000
@@ -8,7 +8,7 @@
 DROP TABLE IF EXISTS Books;
 DROP TABLE IF EXISTS Authors;
 DROP TABLE IF EXISTS Publishers;
-
+DROP TABLE IF EXISTS DataTypeTests;
 
 CREATE TABLE Employees(
 	Id INT NOT NULL PRIMARY KEY,
@@ -132,3 +132,12 @@
 INSERT INTO Books VALUES (2, 'Insomnia', 350, 2, 1);
 INSERT INTO Books VALUES (3, 'Rainmaker', 475, 3, 1);
 
+SET @guid=UUID();
+CREATE TABLE DataTypeTests(
+	id CHAR(36) CHARACTER SET utf8 NOT NULL PRIMARY KEY,
+	id2 CHAR(36) BINARY NOT NULL,
+	idAsChar VARCHAR(36));
+INSERT INTO DataTypeTests VALUES (@guid, @guid, @guid);	
+INSERT INTO DataTypeTests VALUES ('481A6506-03A3-4ef9-A05A-B247E75A2FB4',
+	'481A6506-03A3-4ef9-A05A-B247E75A2FB4', '481A6506-03A3-4ef9-A05A-B247E75A2FB4');
+

=== modified file 'MySql.Data.Entity/Tests/TestModel.Designer.cs'
--- a/MySql.Data.Entity/Tests/TestModel.Designer.cs	2009-10-28 16:02:29 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.Designer.cs	2009-11-03 16:10:05 +0000
@@ -15,7 +15,7 @@
 [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("testModel", "FK_Books_Publishers", "Publishers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(MySql.Data.Entity.Tests.Publisher), "Books", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(MySql.Data.Entity.Tests.Book))]
 
 // Original file name:
-// Generation date: 10/28/2009 11:00:34 AM
+// Generation date: 11/3/2009 9:33:22 AM
 namespace MySql.Data.Entity.Tests
 {
     
@@ -185,6 +185,21 @@
         }
         private global::System.Data.Objects.ObjectQuery<Publisher> _Publishers;
         /// <summary>
+        /// There are no comments for DataTypeTests in the schema.
+        /// </summary>
+        public global::System.Data.Objects.ObjectQuery<DataTypeTest> DataTypeTests
+        {
+            get
+            {
+                if ((this._DataTypeTests == null))
+                {
+                    this._DataTypeTests = base.CreateQuery<DataTypeTest>("[DataTypeTests]");
+                }
+                return this._DataTypeTests;
+            }
+        }
+        private global::System.Data.Objects.ObjectQuery<DataTypeTest> _DataTypeTests;
+        /// <summary>
         /// There are no comments for Employees in the schema.
         /// </summary>
         public void AddToEmployees(Employee employee)
@@ -247,6 +262,13 @@
         {
             base.AddObject("Publishers", publisher);
         }
+        /// <summary>
+        /// There are no comments for DataTypeTests in the schema.
+        /// </summary>
+        public void AddToDataTypeTests(DataTypeTest dataTypeTest)
+        {
+            base.AddObject("DataTypeTests", dataTypeTest);
+        }
     }
     /// <summary>
     /// There are no comments for testModel.Employee in the schema.
@@ -1654,4 +1676,97 @@
             }
         }
     }
+    /// <summary>
+    /// There are no comments for testModel.DataTypeTest in the schema.
+    /// </summary>
+    /// <KeyProperties>
+    /// id
+    /// </KeyProperties>
+    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="testModel", Name="DataTypeTest")]
+    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
+    [global::System.Serializable()]
+    public partial class DataTypeTest : global::System.Data.Objects.DataClasses.EntityObject
+    {
+        /// <summary>
+        /// Create a new DataTypeTest object.
+        /// </summary>
+        /// <param name="id">Initial value of id.</param>
+        /// <param name="id2">Initial value of id2.</param>
+        public static DataTypeTest CreateDataTypeTest(global::System.Guid id, global::System.Guid id2)
+        {
+            DataTypeTest dataTypeTest = new DataTypeTest();
+            dataTypeTest.id = id;
+            dataTypeTest.id2 = id2;
+            return dataTypeTest;
+        }
+        /// <summary>
+        /// There are no comments for Property id in the schema.
+        /// </summary>
+        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
+        [global::System.Runtime.Serialization.DataMemberAttribute()]
+        public global::System.Guid id
+        {
+            get
+            {
+                return this._id;
+            }
+            set
+            {
+                this.OnidChanging(value);
+                this.ReportPropertyChanging("id");
+                this._id = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+                this.ReportPropertyChanged("id");
+                this.OnidChanged();
+            }
+        }
+        private global::System.Guid _id;
+        partial void OnidChanging(global::System.Guid value);
+        partial void OnidChanged();
+        /// <summary>
+        /// There are no comments for Property id2 in the schema.
+        /// </summary>
+        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
+        [global::System.Runtime.Serialization.DataMemberAttribute()]
+        public global::System.Guid id2
+        {
+            get
+            {
+                return this._id2;
+            }
+            set
+            {
+                this.Onid2Changing(value);
+                this.ReportPropertyChanging("id2");
+                this._id2 = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+                this.ReportPropertyChanged("id2");
+                this.Onid2Changed();
+            }
+        }
+        private global::System.Guid _id2;
+        partial void Onid2Changing(global::System.Guid value);
+        partial void Onid2Changed();
+        /// <summary>
+        /// There are no comments for Property idAsChar in the schema.
+        /// </summary>
+        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
+        [global::System.Runtime.Serialization.DataMemberAttribute()]
+        public string idAsChar
+        {
+            get
+            {
+                return this._idAsChar;
+            }
+            set
+            {
+                this.OnidAsCharChanging(value);
+                this.ReportPropertyChanging("idAsChar");
+                this._idAsChar = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
+                this.ReportPropertyChanged("idAsChar");
+                this.OnidAsCharChanged();
+            }
+        }
+        private string _idAsChar;
+        partial void OnidAsCharChanging(string value);
+        partial void OnidAsCharChanged();
+    }
 }

=== modified file 'MySql.Data.Entity/Tests/TestModel.csdl'
--- a/MySql.Data.Entity/Tests/TestModel.csdl	2009-09-01 00:49:03 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.csdl	2009-11-03 16:10:05 +0000
@@ -27,6 +27,7 @@
       <End Role="Publishers" EntitySet="Publishers" />
       <End Role="Books" EntitySet="Books" />
     </AssociationSet>
+    <EntitySet Name="DataTypeTests" EntityType="testModel.DataTypeTest"/>
   </EntityContainer>
 
   <EntityType Name="Employee">
@@ -155,4 +156,13 @@
     <End Role="Publishers" Type="testModel.Publisher" Multiplicity="1" />
     <End Role="Books" Type="testModel.Book" Multiplicity="*" />
   </Association>
+
+  <EntityType Name="DataTypeTest">
+    <Key>
+      <PropertyRef Name="id"/>
+    </Key>
+    <Property Name="id" Type="Guid" Nullable="false"/>
+    <Property Name="id2" Type="Guid" Nullable ="false"/>
+    <Property Name="idAsChar" Type="String" Nullable="true"/>
+  </EntityType>
 </Schema>

=== modified file 'MySql.Data.Entity/Tests/TestModel.msl'
--- a/MySql.Data.Entity/Tests/TestModel.msl	2009-08-10 21:17:20 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.msl	2009-11-03 16:10:05 +0000
@@ -174,7 +174,16 @@
       <EndProperty Name="Books">
         <ScalarProperty Name="Id" ColumnName="Id" />
       </EndProperty>
-    </AssociationSetMapping>  
-  
+    </AssociationSetMapping>
+
+    <EntitySetMapping Name="DataTypeTests">
+      <EntityTypeMapping TypeName="testModel.DataTypeTest">
+        <MappingFragment StoreEntitySet="DataTypeTests">
+          <ScalarProperty Name="id" ColumnName="id" />
+          <ScalarProperty Name="id2" ColumnName="id2" />
+          <ScalarProperty Name="idAsChar" ColumnName="idAsChar"/>
+        </MappingFragment>
+      </EntityTypeMapping>
+    </EntitySetMapping>
   </EntityContainerMapping>
 </Mapping>
\ No newline at end of file

=== modified file 'MySql.Data.Entity/Tests/TestModel.ssdl'
--- a/MySql.Data.Entity/Tests/TestModel.ssdl	2009-09-01 00:49:03 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.ssdl	2009-11-03 16:10:05 +0000
@@ -27,6 +27,7 @@
       <End Role="Publishers" EntitySet="Publishers" />
       <End Role="Books" EntitySet="Books" />
     </AssociationSet>
+    <EntitySet Name="DataTypeTests" EntityType="testModel.Store.DataTypeTests"/>
   </EntityContainer>
 
   <EntityType Name="Employees">
@@ -199,4 +200,12 @@
     <Parameter Name="theage" Type="int" Mode="In" />
   </Function>
 
+  <EntityType Name="DataTypeTests">
+    <Key>
+      <PropertyRef Name="id"/>
+    </Key>
+    <Property Name="id" Type="guid" Nullable="false"/>
+    <Property Name="id2" Type="guid" Nullable ="false"/>
+    <Property Name="idAsChar" Type="varchar" MaxLength="36" Nullable="true"/>
+  </EntityType>  
 </Schema>
\ No newline at end of file


Attachment: [text/bzr-bundle] bzr/reggie.burnett@sun.com-20091103161852-ab6o6muuix5otwd5.bundle
Thread
bzr commit into connector-net-trunk branch (reggie.burnett:793)Bug#48417Reggie Burnett3 Nov