Commit fa03d54b authored by Marc Gravell's avatar Marc Gravell

Attempt (unsuccessful) to repro #426

parent 80d33f06
......@@ -2942,7 +2942,35 @@ public void Issue295_NullableDateTime_MySql_ConvertAllowZeroDatetime()
{
using (var conn = GetMySqlConnection(true, true, true)) { TestDateTime(connection); }
}
[FactMySql]
public void Issue426_SO34439033_DateTimeGainsTicks()
{
using (var conn = GetMySqlConnection())
{
try { conn.Execute("drop table Issue426_Test"); } catch { }
try { conn.Execute("create table Issue426_Test (Id int not null, Time time not null)"); } catch { }
const long ticks = 553440000000;
const int Id = 426;
var localObj = new Issue426_Test
{
Id = Id,
Time = TimeSpan.FromTicks(ticks) // from code example
};
conn.Execute("replace into Issue426_Test values (@Id,@Time)", localObj);
var dbObj = conn.Query<Issue426_Test>("select * from Issue426_Test where Id = @id", new { id = Id }).Single();
dbObj.Id.IsEqualTo(Id);
dbObj.Time.Value.Ticks.IsEqualTo(ticks);
}
}
public class Issue426_Test
{
public long Id { get; set; }
public TimeSpan? Time { get; set; }
}
public class FactMySqlAttribute : FactAttribute
{
public override string Skip
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment