Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit e47e1f8

Browse files
committed
Fix out of bound issue for SQL Server
1 parent 402d815 commit e47e1f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/ServiceStack.OrmLite.Tests/ExpressionVisitorTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,16 +371,18 @@ public void Can_Where_using_filter_with_nested_properties()
371371
var target = Db.Select(q);
372372
Assert.That(target.Count, Is.EqualTo(2));
373373

374+
var minDate = new DateTime(1900, 01, 01);
375+
374376
q = Db.From<TestType>().
375377
Join<TestType2>().
376-
Where(x => x.TestType2ObjCol.BoolCol && x.DateCol != DateTime.MinValue);
378+
Where(x => x.TestType2ObjCol.BoolCol && x.DateCol != minDate);
377379
target = Db.Select(q);
378380
Assert.That(target.Count, Is.EqualTo(2));
379381

380382
q = Db.From<TestType>().
381383
Join<TestType2>().
382384
Where(x => x.TestType2ObjCol.BoolCol && x.TestType2ObjCol.BoolCol == nullableTrue &&
383-
x.DateCol != DateTime.MinValue && x.TestType2ObjCol.TestType2Name == filterText2);
385+
x.DateCol != minDate && x.TestType2ObjCol.TestType2Name == filterText2);
384386
target = Db.Select(q);
385387
Assert.That(target.Count, Is.EqualTo(1));
386388

0 commit comments

Comments
 (0)