Skip to content

Commit afabc24

Browse files
committed
Merge branch 'master' of https://github.com/nhibernate/nhibernate-core into dbbatch
2 parents 318cc2c + 07c0502 commit afabc24

File tree

69 files changed

+400
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+400
-218
lines changed

.editorconfig

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ dotnet_diagnostic.NUnit2006.severity = suggestion
2525
dotnet_diagnostic.NUnit2015.severity = suggestion
2626
dotnet_diagnostic.NUnit2031.severity = suggestion
2727
dotnet_diagnostic.NUnit2049.severity = suggestion
28-
# NUnit 4 no longer supports string.Format specification for Assert
29-
dotnet_diagnostic.NUnit2050.severity = suggestion
3028
# The SameAs constraint always fails on value types as the actual and the expected value cannot be the same reference
3129
dotnet_diagnostic.NUnit2040.severity = suggestion
3230
dotnet_diagnostic.CA1849.severity = error
@@ -40,17 +38,10 @@ indent_style = tab
4038
indent_style = space
4139
indent_size = 2
4240

43-
[*.xml]
44-
indent_style = space
45-
indent_size = 2
46-
47-
[*.csproj]
48-
indent_style = space
49-
indent_size = 2
50-
51-
[*.vbproj]
41+
[{*.xml,*.csproj,*.vbproj}]
5242
indent_style = space
5343
indent_size = 2
44+
ij_xml_space_inside_empty_tag = true
5445

5546
[*.g]
5647
indent_style = tab

Tools/packages.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="NUnit.Console" Version="3.16.3" />
14+
<PackageReference Include="NUnit.Console" Version="3.17.0" />
1515
</ItemGroup>
1616

1717
</Project>

releasenotes.txt

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
Build 5.5.0
1+
Build 5.5.1
2+
=============================
3+
4+
Release notes - NHibernate - Version 5.5.1
5+
6+
3 issues were resolved in this release.
7+
8+
** Bug
9+
10+
* #3465 Invalid SQL created for some joins in a subquery
11+
12+
** Task
13+
14+
* #3509 Release 5.5.1
15+
* #3508 Merge 5.4.8 into 5.5.x
16+
17+
18+
Build 5.5.0
219
=============================
320

421
Release notes - NHibernate - Version 5.5.0
@@ -88,6 +105,22 @@ Release notes - NHibernate - Version 5.5.0
88105
* #3412 Revive hql ParsingFixture
89106

90107

108+
Build 5.4.8
109+
=============================
110+
111+
Release notes - NHibernate - Version 5.4.8
112+
113+
2 issues were resolved in this release.
114+
115+
** Bug
116+
117+
* #3489 Inserting multiple associations of the same entity fails
118+
119+
** Task
120+
121+
* #3507 Release 5.4.8
122+
123+
91124
Build 5.4.7
92125
=============================
93126

src/NHibernate.Test/Async/BulkManipulation/HQLBulkOperations.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,21 @@ public async Task SimpleDeleteAsync()
4343
await (tx.CommitAsync());
4444
}
4545
}
46+
47+
[Test]
48+
public async Task InsertFromSelectWithMultipleAssociationsAsync()
49+
{
50+
Assume.That(TestDialect.NativeGeneratorSupportsBulkInsertion,
51+
"The dialect does not support a native generator compatible with bulk insertion.");
52+
53+
using var s = OpenSession();
54+
using var tx = s.BeginTransaction();
55+
56+
await (s.CreateQuery("insert into Enrolment (Course, Student)" +
57+
" select e.Course, e.Student from Enrolment e")
58+
.ExecuteUpdateAsync());
59+
60+
await (tx.CommitAsync());
61+
}
4662
}
47-
}
63+
}

src/NHibernate.Test/Async/Criteria/Lambda/IntegrationFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public async Task MultiCriteriaAsync()
358358
{
359359
var driver = Sfi.ConnectionProvider.Driver;
360360
if (!driver.SupportsMultipleQueries)
361-
Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);
361+
Assert.Ignore($"Driver {driver.GetType().FullName} does not support multi-queries");
362362

363363
await (SetupPagingDataAsync());
364364

src/NHibernate.Test/Async/Criteria/ProjectionsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public async Task UsingSqlFunctions_Concat_WithCastAsync()
9191
{
9292
if(Dialect is Oracle8iDialect)
9393
{
94-
Assert.Ignore("Not supported by the active dialect:{0}.", Dialect);
94+
Assert.Ignore($"Not supported by the active dialect:{Dialect}.");
9595
}
9696
if (TestDialect.HasBrokenTypeInferenceOnSelectedParameters)
9797
Assert.Ignore("Current dialect does not support this test");

src/NHibernate.Test/Async/Criteria/SelectModeTest/SelectModeTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ public async Task FetchModeEagerForEagerAsync()
663663
private void SkipFutureTestIfNotSupported()
664664
{
665665
if (Sfi.ConnectionProvider.Driver.SupportsMultipleQueries == false)
666-
Assert.Ignore("Driver {0} does not support multi-queries", Sfi.ConnectionProvider.Driver.GetType().FullName);
666+
Assert.Ignore($"Driver {Sfi.ConnectionProvider.Driver.GetType().FullName} does not support multi-queries");
667667
}
668668

669669
#region Test Setup

src/NHibernate.Test/Async/Extralazy/ExtraLazyFixture.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public async Task ListAddAsync(bool initialize)
114114
// Have to skip unloaded (non-queued indeed) elements to avoid triggering existence queries on them.
115115
foreach (var item in addedItems.Skip(5))
116116
{
117-
Assert.That(gavin.Companies.Contains(item), Is.True, "Company '{0}' existence", item.Name);
117+
Assert.That(gavin.Companies.Contains(item), Is.True, $"Company '{item.Name}' existence");
118118
}
119119

120120
Assert.That(Sfi.Statistics.FlushCount, Is.EqualTo(0), "Flushes count after checking existence of non-flushed");
@@ -322,7 +322,7 @@ public async Task ListInsertAsync(bool initialize)
322322
// Have to skip unloaded (non-queued indeed) elements to avoid triggering existence queries on them.
323323
foreach (var item in addedItems.Skip(5))
324324
{
325-
Assert.That(gavin.Companies.Contains(item), Is.True, "Company '{0}' existence", item.Name);
325+
Assert.That(gavin.Companies.Contains(item), Is.True, $"Company '{item.Name}' existence");
326326
}
327327

328328
Assert.That(Sfi.Statistics.FlushCount, Is.EqualTo(0), "Flushes count after existence check");
@@ -636,7 +636,7 @@ public async Task ListGetSetAsync(bool initialize)
636636
Sfi.Statistics.Clear();
637637
for (var i = 0; i < 10; i++)
638638
{
639-
Assert.That(gavin.Companies[i], Is.EqualTo(addedItems[i]), "Comparing added company at index {0}", i);
639+
Assert.That(gavin.Companies[i], Is.EqualTo(addedItems[i]), $"Comparing added company at index {i}");
640640
}
641641

642642
Assert.That(Sfi.Statistics.FlushCount, Is.EqualTo(0), "Flushes count after adding comparing");
@@ -676,7 +676,7 @@ public async Task ListGetSetAsync(bool initialize)
676676
Sfi.Statistics.Clear();
677677
for (var i = 0; i < 10; i++)
678678
{
679-
Assert.That(gavin.Companies[i].ListIndex, Is.EqualTo(finalIndexOrder[i]), "Comparing company ListIndex at index {0}", i);
679+
Assert.That(gavin.Companies[i].ListIndex, Is.EqualTo(finalIndexOrder[i]), $"Comparing company ListIndex at index {i}");
680680
}
681681

682682
Assert.That(Sfi.Statistics.FlushCount, Is.EqualTo(0), "Flushes count after comparing");
@@ -798,7 +798,7 @@ public async Task ListFlushAsync(bool initialize)
798798
{
799799
for (var i = 15; i < 20; i++)
800800
{
801-
Assert.That(gavin.Companies.Remove(addedItems[i]), Is.True, "Removing transient company at index {0}", i);
801+
Assert.That(gavin.Companies.Remove(addedItems[i]), Is.True, $"Removing transient company at index {i}");
802802
}
803803

804804
Assert.That(FindAllOccurrences(sqlLog.GetWholeLog(), "INSERT \n INTO"), Is.EqualTo(10), "Statements count after removing");
@@ -909,7 +909,7 @@ public async Task ListFlushAsync(bool initialize)
909909

910910
for (var i = 0; i < gavin.Companies.Count; i++)
911911
{
912-
Assert.That(gavin.Companies[i].ListIndex, Is.EqualTo(i), "Comparing company ListIndex at index {0}", i);
912+
Assert.That(gavin.Companies[i].ListIndex, Is.EqualTo(i), $"Comparing company ListIndex at index {i}");
913913
}
914914

915915
if (initialize)
@@ -1049,7 +1049,7 @@ public async Task ListClearAsync(bool initialize)
10491049
Assert.That(collection.Count, Is.EqualTo(6), "Credit cards count after loading again Gavin");
10501050
for (var i = 0; i < 10; i++)
10511051
{
1052-
Assert.That(collection.Contains(addedItems[i]), i < 6 ? Is.True : (IResolveConstraint) Is.False, "Checking existence for item at {0}", i);
1052+
Assert.That(collection.Contains(addedItems[i]), i < 6 ? Is.True : (IResolveConstraint) Is.False, $"Checking existence for item at {i}");
10531053
}
10541054

10551055
Assert.That(NHibernateUtil.IsInitialized(collection), Is.False, "Credit cards initialization status after loading again");
@@ -1140,7 +1140,7 @@ public async Task ListIndexOperationsAsync(bool initialize)
11401140

11411141
for (var i = 0; i < gavin.Companies.Count; i++)
11421142
{
1143-
Assert.That(gavin.Companies[i].OriginalIndex, Is.EqualTo(finalIndexOrder[i]), "Comparing company index at {0}", i);
1143+
Assert.That(gavin.Companies[i].OriginalIndex, Is.EqualTo(finalIndexOrder[i]), $"Comparing company index at {i}");
11441144
}
11451145

11461146
if (initialize)
@@ -1882,8 +1882,7 @@ public async Task SetClearAsync(bool initialize)
18821882
Assert.That(collection.Count, Is.EqualTo(6), "Permissions count after loading again Gavin");
18831883
for (var i = 0; i < 10; i++)
18841884
{
1885-
Assert.That(collection.Contains(addedItems[i]), i < 6 ? Is.True : (IResolveConstraint) Is.False,
1886-
"Checking existence of added element at {0}", i);
1885+
Assert.That(collection.Contains(addedItems[i]), i < 6 ? Is.True : (IResolveConstraint) Is.False, $"Checking existence of added element at {i}");
18871886
}
18881887

18891888
Assert.That(NHibernateUtil.IsInitialized(collection), Is.False, "Permissions initialization status after loading again");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ public async Task SimpleDeleteOnAnimalAsync()
884884
{
885885
if (Dialect.HasSelfReferentialForeignKeyBug)
886886
{
887-
Assert.Ignore("self referential FK bug", "HQL delete testing");
887+
Assert.Ignore("self referential FK bug - HQL delete testing");
888888
return;
889889
}
890890

src/NHibernate.Test/Async/IdGen/NativeGuid/NativeGuidGeneratorFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task ReturnedValueIsGuidAsync()
4343
}
4444
catch (NotSupportedException)
4545
{
46-
Assert.Ignore("This test does not apply to {0}", Dialect.Dialect.GetDialect());
46+
Assert.Ignore($"This test does not apply to {Dialect.Dialect.GetDialect()}");
4747
}
4848

4949
var gen = new NativeGuidGenerator();

src/NHibernate.Test/Async/Linq/FunctionTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ where lowerName.IndexOf('a') == 0
204204
select lowerName;
205205
var result = await (query.ToListAsync());
206206

207-
Assert.That(result, Is.EqualTo(expected), "Expected {0} but was {1}", string.Join("|", expected), string.Join("|", result));
207+
Assert.That(result, Is.EqualTo(expected), $"Expected {string.Join("|", expected)} but was {string.Join("|", result)}");
208208
await (ObjectDumper.WriteAsync(query));
209209
}
210210

@@ -220,7 +220,7 @@ where lowerName.IndexOf('a', 2) == -1
220220
select lowerName;
221221
var result = await (query.ToListAsync());
222222

223-
Assert.That(result, Is.EqualTo(expected), "Expected {0} but was {1}", string.Join("|", expected), string.Join("|", result));
223+
Assert.That(result, Is.EqualTo(expected), $"Expected {string.Join("|", expected)} but was {string.Join("|", result)}");
224224
await (ObjectDumper.WriteAsync(query));
225225
}
226226

@@ -236,7 +236,7 @@ where lowerName.IndexOf("an") == 0
236236
select lowerName;
237237
var result = await (query.ToListAsync());
238238

239-
Assert.That(result, Is.EqualTo(expected), "Expected {0} but was {1}", string.Join("|", expected), string.Join("|", result));
239+
Assert.That(result, Is.EqualTo(expected), $"Expected {string.Join("|", expected)} but was {string.Join("|", result)}");
240240
await (ObjectDumper.WriteAsync(query));
241241
}
242242

@@ -252,7 +252,7 @@ where lowerName.Contains("a")
252252
select lowerName.IndexOf("a", 1);
253253
var result = await (query.ToListAsync());
254254

255-
Assert.That(result, Is.EqualTo(expected), "Expected {0} but was {1}", string.Join("|", expected), string.Join("|", result));
255+
Assert.That(result, Is.EqualTo(expected), $"Expected {string.Join("|", expected)} but was {string.Join("|", result)}");
256256
await (ObjectDumper.WriteAsync(query));
257257
}
258258

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System.Linq;
12+
using NUnit.Framework;
13+
14+
namespace NHibernate.Test.NHSpecificTest.GH3465
15+
{
16+
using System.Threading.Tasks;
17+
[TestFixture]
18+
public class FixtureAsync : BugTestCase
19+
{
20+
[Test]
21+
public void ThetaJoinSubQueryAsync()
22+
{
23+
using (var session = OpenSession())
24+
using (session.BeginTransaction())
25+
{
26+
var query = session.CreateQuery("select e.Id from EntityA e where exists (from e.Children b, EntityC c)");
27+
Assert.DoesNotThrowAsync(() => query.ListAsync());
28+
}
29+
}
30+
}
31+
}

src/NHibernate.Test/Async/NHSpecificTest/NH1253/Fixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public async Task MultiQuerySingleInListAsync()
8585
{
8686
var driver = Sfi.ConnectionProvider.Driver;
8787
if (!driver.SupportsMultipleQueries)
88-
Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);
88+
Assert.Ignore($"Driver {driver.GetType().FullName} does not support multi-queries");
8989

9090
using (var s = OpenSession())
9191
using (var tx = s.BeginTransaction())

src/NHibernate.Test/Async/NHSpecificTest/NH1612/NativeSqlCollectionLoaderFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public async Task LoadEntityCollectionWithCustomLoaderAsync()
244244
[Test]
245245
public async Task NativeUpdateQueryWithoutResultsAsync()
246246
{
247-
Assume.That(Dialect, Is.InstanceOf<MsSql2000Dialect>(), "This does not apply to {0}", Dialect);
247+
Assume.That(Dialect, Is.InstanceOf<MsSql2000Dialect>(), $"This does not apply to {Dialect}");
248248
Assume.That(WithQueryCache, Is.False, "This test does not use a cacheable query.");
249249
using (ISession session = OpenSession())
250250
{
@@ -259,7 +259,7 @@ public async Task NativeUpdateQueryWithoutResultsAsync()
259259
[Test]
260260
public async Task NativeScalarQueryWithoutResultsAsync()
261261
{
262-
Assume.That(Dialect, Is.InstanceOf<MsSql2000Dialect>(), "This does not apply to {0}", Dialect);
262+
Assume.That(Dialect, Is.InstanceOf<MsSql2000Dialect>(), $"This does not apply to {Dialect}");
263263
Assume.That(WithQueryCache, Is.False, "This test does not use a cacheable query.");
264264
using (ISession session = OpenSession())
265265
{
@@ -278,7 +278,7 @@ public async Task NativeScalarQueryWithUndefinedResultsetAsync()
278278
{
279279
if (!(Dialect is MsSql2000Dialect))
280280
{
281-
Assert.Ignore("This does not apply to {0}", Dialect);
281+
Assert.Ignore($"This does not apply to {Dialect}");
282282
}
283283
using (ISession session = OpenSession())
284284
{
@@ -301,7 +301,7 @@ public async Task NativeScalarQueryWithDefinedResultsetAsync()
301301
{
302302
if (!(Dialect is MsSql2000Dialect))
303303
{
304-
Assert.Ignore("This does not apply to {0}", Dialect);
304+
Assert.Ignore($"This does not apply to {Dialect}");
305305
}
306306
using (ISession session = OpenSession())
307307
{

src/NHibernate.Test/Async/NHSpecificTest/NH2195/SQLiteMultiCriteriaTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public async Task MultiCriteriaQueriesWithIntsShouldExecuteCorrectlyAsync()
102102
{
103103
var driver = Sfi.ConnectionProvider.Driver;
104104
if (!driver.SupportsMultipleQueries)
105-
Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);
105+
Assert.Ignore($"Driver {driver.GetType().FullName} does not support multi-queries");
106106

107107
// Test querying IntData
108108
using (ISession session = this.OpenSession())
@@ -131,7 +131,7 @@ public async Task MultiCriteriaQueriesWithStringsShouldExecuteCorrectlyAsync()
131131
{
132132
var driver = Sfi.ConnectionProvider.Driver;
133133
if (!driver.SupportsMultipleQueries)
134-
Assert.Ignore("Driver {0} does not support multi-queries", driver.GetType().FullName);
134+
Assert.Ignore($"Driver {driver.GetType().FullName} does not support multi-queries");
135135

136136
// Test querying StringData
137137
using (ISession session = this.OpenSession())

src/NHibernate.Test/Async/NHSpecificTest/NH3023/DeadlockConnectionPoolIssueTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public async Task ConnectionPoolCorruptionAfterDeadlockAsync(bool distributed, b
124124
//
125125
// ? This shouldn't happen
126126
//
127-
Assert.Fail("Surprising exception when trying to force a deadlock: {0}", x);
127+
Assert.Fail($"Surprising exception when trying to force a deadlock: {x}");
128128
}
129129

130130
_log.WarnFormat("Initial session seemingly not deadlocked at attempt {0}", tryCount);
@@ -254,11 +254,11 @@ public async Task ConnectionPoolCorruptionAfterDeadlockAsync(bool distributed, b
254254
}
255255
}
256256

257-
Assert.Fail("{0}; {1} subsequent requests failed.",
258-
missingDeadlock
259-
? "Deadlock not reported on initial request, and initial request failed"
260-
: "Initial request failed",
261-
subsequentFailedRequests);
257+
Assert.Fail(
258+
missingDeadlock
259+
? $"Deadlock not reported on initial request, and initial request failed; {subsequentFailedRequests} subsequent requests failed."
260+
: $"Initial request failed; {subsequentFailedRequests} subsequent requests failed.");
261+
262262
} while (tryCount < 3);
263263
//
264264
// I'll change this to while(true) sometimes so I don't have to keep running the test

src/NHibernate.Test/Async/NHSpecificTest/NH3952/Fixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ public static MethodInfo GetMethodDefinition2<T, TResult>(Func<T, TResult> func,
106106
return method.IsGenericMethod ? method.GetGenericMethodDefinition() : method;
107107
}
108108
}
109-
}
109+
}

0 commit comments

Comments
 (0)