Skip to content

Commit 9265093

Browse files
Fix bulk insert from children of same parent
fix #3489
1 parent 11984a0 commit 9265093

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task SimpleDeleteAsync()
4444
}
4545
}
4646

47-
[Test, KnownBug("#3489")]
47+
[Test]
4848
public async Task InsertFromSelectWithMultipleAssociationsAsync()
4949
{
5050
using var s = OpenSession();

src/NHibernate.Test/BulkManipulation/HQLBulkOperations.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void SimpleDelete()
3333
}
3434
}
3535

36-
[Test, KnownBug("#3489")]
36+
[Test]
3737
public void InsertFromSelectWithMultipleAssociations()
3838
{
3939
using var s = OpenSession();

src/NHibernate/Hql/Ast/ANTLR/Tree/SelectClause.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,14 @@ private void RenderNonScalarIdentifiers(
493493
continue;
494494
}
495495

496-
var node = (IASTNode) e;
497-
if (processedElements.Add(fromElement))
496+
var isNewFrom = processedElements.Add(fromElement);
497+
if (isNewFrom)
498498
{
499499
combinedFromElements.Add(fromElement);
500+
}
501+
var node = (IASTNode) e;
502+
if (isNewFrom || node.Type == SqlGenerator.DOT)
503+
{
500504
RenderNonScalarIdentifiers(fromElement, inheritedExpressions.ContainsKey(e) ? null : e, appender);
501505
}
502506
else if (!inheritedExpressions.ContainsKey(e) && node.Parent != null)

0 commit comments

Comments
 (0)