Skip to content

Commit 84ca202

Browse files
NH-1752 - Adjustments to squash.
1 parent f2acae4 commit 84ca202

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/NHibernate.Test/Async/TypesTest/DateTypeTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Task ReadWriteNormalAsync()
3232
{
3333
try
3434
{
35-
var expected = DateTime.Today.Date;
35+
var expected = DateTime.Today;
3636

3737
return ReadWriteAsync(expected);
3838
}
@@ -77,6 +77,7 @@ public Task ReadWriteYear750Async()
7777

7878
private async Task ReadWriteAsync(DateTime expected, CancellationToken cancellationToken = default(CancellationToken))
7979
{
80+
// Add an hour to check it is correctly ignored once read back from db.
8081
var basic = new DateClass { DateValue = expected.AddHours(1) };
8182
object savedId;
8283
using (var s = OpenSession())

src/NHibernate.Test/TypesTest/DateTypeTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void ShouldBeDateType()
5454
[Test]
5555
public void ReadWriteNormal()
5656
{
57-
var expected = DateTime.Today.Date;
57+
var expected = DateTime.Today;
5858

5959
ReadWrite(expected);
6060
}
@@ -80,6 +80,7 @@ public void ReadWriteYear750()
8080

8181
private void ReadWrite(DateTime expected)
8282
{
83+
// Add an hour to check it is correctly ignored once read back from db.
8384
var basic = new DateClass { DateValue = expected.AddHours(1) };
8485
object savedId;
8586
using (var s = OpenSession())

src/NHibernate/Driver/IDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public interface IDriver
160160
bool HasDelayedDistributedTransactionCompletion { get; }
161161

162162
/// <summary>
163-
/// The minimal date supported by this driver.
163+
/// The minimal date supplied as a <see cref="DateTime" /> supported by this driver.
164164
/// </summary>
165165
DateTime MinDate { get; }
166166
}

src/NHibernate/Driver/MySqlDataDriver.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,10 @@ public override bool SupportsMultipleQueries
9090
}
9191

9292
public override bool RequiresTimeSpanForTime => true;
93+
94+
// As of v5.7, lower dates may "work" but without guarantees.
95+
// https://dev.mysql.com/doc/refman/5.7/en/datetime.html
96+
/// <inheritdoc />
97+
public override DateTime MinDate => new DateTime(1000, 1, 1);
9398
}
9499
}

0 commit comments

Comments
 (0)