Skip to content

Commit f0f5a21

Browse files
committed
PostgreSQL: fix failing tests
- The BulkManipulation.UpdateMultiplePropertyOnAnimal and BulkManipulation.UpdateOnAnimal tests were using Double parameter types to update the Single column. It seems that now Npgsql calculates parameter types according to the columns they touches and fails to set the parameters in this case. - The CriteriaQueryTest.TestSubcriteriaBeingNull were using the Int32 parameter type instead of expected Double.
1 parent 72fddda commit f0f5a21

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/NHibernate.Test/Criteria/CriteriaQueryTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void TestSubcriteriaBeingNull()
143143

144144
DetachedCriteria criteria = DetachedCriteria.For<Course>("c");
145145
criteria.SetProjection(Projections.Count("id"));
146-
criteria.Add(Expression.Or(Subqueries.Le(5, subcriteria), Subqueries.IsNull(subcriteria)));
146+
criteria.Add(Expression.Or(Subqueries.Le(5D, subcriteria), Subqueries.IsNull(subcriteria)));
147147

148148
object o = criteria.GetExecutableCriteria(session).UniqueResult();
149149
Assert.AreEqual(1, o);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,8 @@ public void UpdateOnAnimal()
619619

620620
count =
621621
s.CreateQuery("update Animal set bodyWeight = bodyWeight + :w1 + :w2")
622-
.SetDouble("w1", 1)
623-
.SetDouble("w2", 2)
622+
.SetSingle("w1", 1)
623+
.SetSingle("w2", 2)
624624
.ExecuteUpdate();
625625
Assert.That(count, Is.EqualTo(6), "incorrect count on 'complex' update assignment");
626626

@@ -649,7 +649,7 @@ public void UpdateMultiplePropertyOnAnimal()
649649
s.CreateQuery("update Animal set description = :newDesc, bodyWeight = :w1 where description = :desc")
650650
.SetString("desc", data.Polliwog.Description)
651651
.SetString("newDesc", "Tadpole")
652-
.SetDouble("w1", 3)
652+
.SetSingle("w1", 3)
653653
.ExecuteUpdate();
654654

655655
Assert.That(count, Is.EqualTo(1));

0 commit comments

Comments
 (0)