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

Fix to #25842 - Cosmos: Translate string.Equals with StringComparison.Ordinal #25875

Merged
merged 1 commit into from
Sep 5, 2021

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Sep 4, 2021

Fixes #25842


return _stringComparisonWithComparisonTypeArgumentInstance.Equals(method)
? TranslateSystemFunction("STRINGEQUALS", typeof(bool), instance!, arguments[0], _sqlExpressionFactory.Constant(true))
: TranslateSystemFunction("STRINGEQUALS", typeof(bool), arguments[0], arguments[1], _sqlExpressionFactory.Constant(true));
? TranslateSystemFunction("STRINGEQUALS", typeof(bool), instance!, arguments[0], ignoreCase)
Copy link
Member

Choose a reason for hiding this comment

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

If we really want tight SQL, false is the default value so we can omit the argument altogether.

Copy link
Member

Choose a reason for hiding this comment

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

Looks good!

@maumar maumar force-pushed the fix25842 branch 2 times, most recently from 192ad2e to 3b700b6 Compare September 4, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cosmos: Translate string.Equals with StringComparison.Ordinal
2 participants