Skip to content

Commit

Permalink
Fix bulk insert from children of same parent failure
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericDelaporte committed Mar 17, 2024
1 parent 11984a0 commit cce9059
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task SimpleDeleteAsync()
}
}

[Test, KnownBug("#3489")]
[Test]
public async Task InsertFromSelectWithMultipleAssociationsAsync()
{
using var s = OpenSession();
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate.Test/BulkManipulation/HQLBulkOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void SimpleDelete()
}
}

[Test, KnownBug("#3489")]
[Test]
public void InsertFromSelectWithMultipleAssociations()
{
using var s = OpenSession();
Expand Down
8 changes: 6 additions & 2 deletions src/NHibernate/Hql/Ast/ANTLR/Tree/SelectClause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,14 @@ private void RenderNonScalarIdentifiers(
continue;
}

var node = (IASTNode) e;
if (processedElements.Add(fromElement))
var isNewFrom = processedElements.Add(fromElement);
if (isNewFrom)
{
combinedFromElements.Add(fromElement);
}
var node = (IASTNode) e;
if (isNewFrom || node.Type == SqlGenerator.DOT)
{
RenderNonScalarIdentifiers(fromElement, inheritedExpressions.ContainsKey(e) ? null : e, appender);
}
else if (!inheritedExpressions.ContainsKey(e) && node.Parent != null)
Expand Down

0 comments on commit cce9059

Please sign in to comment.