#At file:///D:/bzr-connector-net/old6.0/ based on revid:reggie.burnett@stripped
746 Reggie Burnett 2009-08-10
- fixed timestamp columns with entity framework (bug #46311)
modified:
CHANGES
MySql.Data.Entity/Provider/Properties/ProviderManifest.xml
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 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2009-08-10 18:03:52 +0000
+++ b/CHANGES 2009-08-10 21:17:20 +0000
@@ -21,6 +21,7 @@
- fixed formatting of single, double, and decimal values when used with entity framework
in cultures that use the comma as a decimal separator (bug #44455)
- fixed GetSByte method to actually return an sbyte (bug #46620)
+- fixed timestamp columns with entity framework (bug #46311)
Version 6.0.4
- fixed regression where using stored procs with datasets (bug #44460)
=== modified file 'MySql.Data.Entity/Provider/Properties/ProviderManifest.xml'
--- a/MySql.Data.Entity/Provider/Properties/ProviderManifest.xml 2009-06-09 19:54:16 +0000
+++ b/MySql.Data.Entity/Provider/Properties/ProviderManifest.xml 2009-08-10 21:17:20 +0000
@@ -39,10 +39,9 @@
<Scale Minimum="0" Maximum="30" DefaultValue="0" Constant="false" />
</FacetDescriptions>
</Type>
- <Type Name="timestamp" PrimitiveTypeKind="Binary">
+ <Type Name="timestamp" PrimitiveTypeKind="DateTime">
<FacetDescriptions>
- <MaxLength DefaultValue="19" Constant="true" />
- <FixedLength DefaultValue="true" Constant="true" />
+ <Precision DefaultValue="0" Constant="true" />
</FacetDescriptions>
</Type>
<Type Name="date" PrimitiveTypeKind="DateTime">
=== modified file 'MySql.Data.Entity/Tests/DataTypeTests.cs'
--- a/MySql.Data.Entity/Tests/DataTypeTests.cs 2009-08-10 17:37:48 +0000
+++ b/MySql.Data.Entity/Tests/DataTypeTests.cs 2009-08-10 21:17:20 +0000
@@ -92,7 +92,11 @@
{
using (testEntities context = new testEntities())
{
- Child c = Child.CreateChild(20, 1, "Rubble", "Bam bam");
+ Child c = new Child();
+ c.Id = 20;
+ c.EmployeeID = 1;
+ c.FirstName = "Bam bam";
+ c.LastName = "Rubble";
c.BirthWeight = 8.65;
context.AddToChildren(c);
context.SaveChanges();
@@ -104,5 +108,25 @@
Thread.CurrentThread.CurrentUICulture = curUICulture;
}
}
+
+ /// <summary>
+ /// Bug #46311 TimeStamp table column Entity Framework issue.
+ /// </summary>
+ [Test]
+ public void TimestampColumn()
+ {
+ DateTime now = DateTime.Now;
+
+ using (testEntities context = new testEntities())
+ {
+ Child c = context.Children.First();
+ DateTime dt = c.Modified;
+ c.Modified = now;
+ context.SaveChanges();
+
+ c = context.Children.First();
+ Assert.AreEqual(now, c.Modified);
+ }
+ }
}
}
\ 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 17:37:48 +0000
+++ b/MySql.Data.Entity/Tests/Properties/schema.sql 2009-08-10 21:17:20 +0000
@@ -38,9 +38,10 @@
LastName NVARCHAR(20) NOT NULL,
FirstName NVARCHAR(10) NOT NULL,
BirthTime TIME,
- Weight DOUBLE);
+ Weight DOUBLE,
+ LastModified TIMESTAMP NOT NULL);
-INSERT INTO EmployeeChildren VALUES (1, 1, 'Flintstone', 'Pebbles', NULL, NULL);
+INSERT INTO EmployeeChildren VALUES (1, 1, 'Flintstone', 'Pebbles', NULL, NULL, NULL);
CREATE TABLE Companies (
`Id` INT NOT NULL AUTO_INCREMENT,
=== modified file 'MySql.Data.Entity/Tests/TestModel.Designer.cs'
--- a/MySql.Data.Entity/Tests/TestModel.Designer.cs 2009-08-10 17:37:48 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.Designer.cs 2009-08-10 21:17:20 +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: 8/10/2009 11:51:12 AM
+// Generation date: 8/10/2009 4:14:43 PM
namespace MySql.Data.Entity.Tests
{
@@ -436,13 +436,15 @@
/// <param name="employeeID">Initial value of EmployeeID.</param>
/// <param name="lastName">Initial value of LastName.</param>
/// <param name="firstName">Initial value of FirstName.</param>
- public static Child CreateChild(long id, int employeeID, string lastName, string firstName)
+ /// <param name="modified">Initial value of Modified.</param>
+ public static Child CreateChild(long id, int employeeID, string lastName, string firstName, global::System.DateTime modified)
{
Child child = new Child();
child.Id = id;
child.EmployeeID = employeeID;
child.LastName = lastName;
child.FirstName = firstName;
+ child.Modified = modified;
return child;
}
/// <summary>
@@ -583,6 +585,29 @@
private global::System.Nullable<double> _BirthWeight;
partial void OnBirthWeightChanging(global::System.Nullable<double> value);
partial void OnBirthWeightChanged();
+ /// <summary>
+ /// There are no comments for Property Modified in the schema.
+ /// </summary>
+ [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable=false)]
+ [global::System.Runtime.Serialization.DataMemberAttribute()]
+ public global::System.DateTime Modified
+ {
+ get
+ {
+ return this._Modified;
+ }
+ set
+ {
+ this.OnModifiedChanging(value);
+ this.ReportPropertyChanging("Modified");
+ this._Modified = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
+ this.ReportPropertyChanged("Modified");
+ this.OnModifiedChanged();
+ }
+ }
+ private global::System.DateTime _Modified;
+ partial void OnModifiedChanging(global::System.DateTime value);
+ partial void OnModifiedChanged();
}
/// <summary>
/// There are no comments for testModel.Company in the schema.
=== modified file 'MySql.Data.Entity/Tests/TestModel.csdl'
--- a/MySql.Data.Entity/Tests/TestModel.csdl 2009-08-10 17:37:48 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.csdl 2009-08-10 21:17:20 +0000
@@ -53,6 +53,7 @@
<Property Name="FirstName" Type="String" Nullable="false" MaxLength="10" />
<Property Name="BirthTime" Type="Time" Nullable="true"/>
<Property Name="BirthWeight" Type="Double" Nullable="true"/>
+ <Property Name="Modified" Type="DateTime" Nullable ="false"/>
</EntityType>
<EntityType Name="Company">
=== modified file 'MySql.Data.Entity/Tests/TestModel.msl'
--- a/MySql.Data.Entity/Tests/TestModel.msl 2009-08-10 17:37:48 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.msl 2009-08-10 21:17:20 +0000
@@ -43,6 +43,7 @@
<ScalarProperty Name="FirstName" ColumnName="FirstName" />
<ScalarProperty Name="BirthTime" ColumnName="BirthTime"/>
<ScalarProperty Name="BirthWeight" ColumnName="Weight"/>
+ <ScalarProperty Name="Modified" ColumnName ="LastModified"/>
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
=== modified file 'MySql.Data.Entity/Tests/TestModel.ssdl'
--- a/MySql.Data.Entity/Tests/TestModel.ssdl 2009-08-10 17:37:48 +0000
+++ b/MySql.Data.Entity/Tests/TestModel.ssdl 2009-08-10 21:17:20 +0000
@@ -57,6 +57,7 @@
<Property Name="FirstName" Type="nvarchar" Nullable="false" MaxLength="10" />
<Property Name="BirthTime" Type="time" Nullable="true"/>
<Property Name="Weight" Type="double" Nullable ="true"/>
+ <Property Name="LastModified" Type="datetime" Nullable ="false"/>
</EntityType>
<EntityType Name="Companies">
Attachment: [text/bzr-bundle] bzr/reggie.burnett@sun.com-20090810211720-41xko9nagd6otm18.bundle
| Thread |
|---|
| • bzr commit into connector-net-6.0 branch (reggie.burnett:746) Bug#46311 | Reggie Burnett | 10 Aug |