Skip to content

Commit d91a7df

Browse files
committed
Merge branch '3.4.x'
2 parents 6cd7b55 + b8854d7 commit d91a7df

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

src/NHibernate.Test/Hql/Ast/HqlFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public void InsertIntoFromSelect_WithSelectClauseParameters()
305305

306306
// assert
307307
Assert.AreEqual(3, s.CreateCriteria<Animal>().SetProjection(Projections.RowCount())
308-
.Add(Restrictions.Eq("bodyWeight", 5.7f)).UniqueResult<int>());
308+
.Add(Restrictions.Gt("bodyWeight", 5.5f)).UniqueResult<int>());
309309

310310
s.CreateQuery("delete from Animal").ExecuteUpdate();
311311
s.Transaction.Commit();

src/NHibernate.Test/VersionTest/Db/DbVersionFixture.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ public void CollectionNoVersion()
8989
t.Commit();
9090
s.Close();
9191

92-
Assert.That(NHibernateUtil.Timestamp.IsEqual(guyTimestamp, guy.Timestamp), "owner version was incremented");
92+
const string ownerVersionWasIncremented = "owner version was incremented ({0:o} => {1:o})";
93+
Assert.That(NHibernateUtil.Timestamp.IsEqual(guyTimestamp, guy.Timestamp),
94+
string.Format(ownerVersionWasIncremented, guyTimestamp, guy.Timestamp));
95+
Console.WriteLine(string.Format(ownerVersionWasIncremented, guyTimestamp, guy.Timestamp));
9396

9497
s = OpenSession();
9598
t = s.BeginTransaction();
@@ -98,7 +101,8 @@ public void CollectionNoVersion()
98101
t.Commit();
99102
s.Close();
100103

101-
Assert.That(NHibernateUtil.Timestamp.IsEqual(guyTimestamp, guy.Timestamp), "owner version was incremented");
104+
Assert.That(NHibernateUtil.Timestamp.IsEqual(guyTimestamp, guy.Timestamp),
105+
string.Format(ownerVersionWasIncremented, guyTimestamp, guy.Timestamp));
102106

103107
s = OpenSession();
104108
t = s.BeginTransaction();

src/NHibernate/Dialect/MsSqlCeDialect.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,14 @@ private static int GetAfterSelectInsertPoint(SqlString sql)
193193
}
194194
throw new NotSupportedException("The query should start with 'SELECT' or 'SELECT DISTINCT'");
195195
}
196+
197+
public override long TimestampResolutionInTicks
198+
{
199+
get
200+
{
201+
// MS SQL resolution is actually 3.33 ms, rounded here to 10 ms
202+
return TimeSpan.TicksPerMillisecond*10L;
203+
}
204+
}
196205
}
197206
}

src/NHibernate/Dialect/MySQLDialect.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,5 +377,14 @@ public override string GetCastTypeName(SqlType sqlType)
377377
}
378378
return result;
379379
}
380+
381+
public override long TimestampResolutionInTicks
382+
{
383+
get
384+
{
385+
// MySQL before version 5.6.4 does not support fractional seconds.
386+
return TimeSpan.TicksPerSecond;
387+
}
388+
}
380389
}
381390
}

src/NHibernate/Dialect/Oracle8iDialect.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,16 @@ public override IDataBaseSchema GetDataBaseSchema(DbConnection connection)
449449
return new OracleDataBaseSchema(connection);
450450
}
451451

452+
public override long TimestampResolutionInTicks
453+
{
454+
get
455+
{
456+
// Timestamps are DateTime, which in this dialect maps to Oracle DATE,
457+
// which doesn't support fractional seconds.
458+
return TimeSpan.TicksPerSecond;
459+
}
460+
}
461+
452462
#region Overridden informational metadata
453463

454464
public override bool SupportsEmptyInList

0 commit comments

Comments
 (0)