Skip to content
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

Query :: using the same variable in query twice results in sql with two different parameters, with the same values #4040

Closed
maumar opened this issue Dec 10, 2015 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@maumar
Copy link
Contributor

maumar commented Dec 10, 2015

linq query:

int i = 10;
            AssertQuery<Customer>(
                cs => cs.Where(c => i + 20 + c.CustomerID + i + 42 == c.CompanyName).Select(c => c.CustomerID));

SQL:

@__i_0: 10
@__i_1: 10

SELECT [c].[CustomerID]
FROM [Customers] AS [c]
WHERE (((CAST(@__i_0 + 20 AS nvarchar(max)) + [c].[CustomerID]) + CAST(@__i_1 AS nvarchar(max))) + CAST(42 AS nvarchar(max))) = [c].[CompanyName]
@rowanmiller rowanmiller added this to the Backlog milestone Dec 15, 2015
@smitpatel smitpatel self-assigned this Nov 12, 2019
smitpatel added a commit that referenced this issue Nov 12, 2019
@smitpatel smitpatel modified the milestones: Backlog, 3.0.0 Nov 12, 2019
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 12, 2019
@smitpatel
Copy link
Contributor

Already fixed in 3.0 release. Test is bit different. In above case we condense i + 20 into one parameter so it generates 2 parameters with different values.

smitpatel added a commit that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

3 participants