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

Only use length-based sized type inference for string concat #33403

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

ajcvickers
Copy link
Member

As opposed to when an Add note is for something other than concatenation.

Fixes #33330

@ajcvickers ajcvickers requested a review from a team March 26, 2024 09:13
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

LGTM, see nits.

@@ -274,6 +279,9 @@ private SqlExpression ApplyTypeMappingOnLike(LikeExpression likeExpression)
ApplyTypeMapping(right, inferredTypeMapping),
resultType,
resultTypeMapping);

static bool IsForString(RelationalTypeMapping? typeMapping)
=> (typeMapping?.Converter?.ProviderClrType ?? typeMapping?.ClrType) == typeof(string);
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to this PR, but we should really have an API on type mapping that does this - feels like I've written/seen this code lots of times already.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking the same thing, but I know I looked at it in the past and didn't add sugar for some reason.

As opposed to when an `Add` note is for something other than concatenation.

Fixes #33330
@ajcvickers ajcvickers merged commit 15b129b into main Mar 27, 2024
7 checks passed
@ajcvickers ajcvickers deleted the 240326_AddManAdd branch March 27, 2024 16:50
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.

ValueConverter not applied to operands on ExecuteUpdateAsync
3 participants