Skip to content

Fix subquery "Item with Same Key has already been added” exception for Linq provider #2664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 14, 2021

Conversation

maca88
Copy link
Contributor

@maca88 maca88 commented Feb 4, 2021

Fixes #2659

@@ -317,8 +317,8 @@ protected HqlTreeNode VisitBinaryExpression(BinaryExpression expression)
var rightType = GetExpressionType(expression.Right);
if (leftType != null && leftType == rightType)
{
_notCastableExpressions.Add(expression.Left, leftType);
_notCastableExpressions.Add(expression.Right, rightType);
_notCastableExpressions.TryAdd(expression.Left, leftType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TryAdd is not available in .net standard 2.0 and .net 4.6.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an extension method for them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maca88 can we replace Add with Set?

_notCastableExpressions[expression.Right] = rightType;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I overlooked the comment. Yes we can, replaced with Set.
Also now I realized that I created the branch to this repository instead on my fork. We should remove the branch after merging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I overlooked the comment.

This is what I thought.

@fredericDelaporte fredericDelaporte added this to the 5.3.6 milestone Feb 6, 2021
@hazzik hazzik self-requested a review February 6, 2021 19:05
@hazzik
Copy link
Member

hazzik commented Feb 10, 2021

@maca88 one last question from me, see in the comments section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants