Skip to content

[5.0.x] SqlServer: Add Cast to (n)varchar(max) when injecting Concat for multi-line seed data - #24944

Merged
wtgodbe merged 1 commit into
release/5.0from
smit/LineBreak
Jun 1, 2021
Merged

[5.0.x] SqlServer: Add Cast to (n)varchar(max) when injecting Concat for multi-line seed data#24944
wtgodbe merged 1 commit into
release/5.0from
smit/LineBreak

Conversation

@smitpatel

Copy link
Copy Markdown
Contributor

Resolves #24112

Description

Silent truncation happens when using seed data containing line breaks and longer than 4000 bytes length.

Customer Impact

This causes corruption in user data due to truncation.

How found

Reported by a customer.

Test coverage

Test coverage for this case has been added in this PR.

Regression?

Yes, from EF Core 3.1.

Risk

Low. The change happens in SQL literal generation which is used extensively in various parts to generate SQL and well covered by tests. The fix is also quirked.

Comment thread src/EFCore.SqlServer/Storage/Internal/SqlServerStringTypeMapping.cs Outdated
@ajcvickers ajcvickers added this to the 5.0.x milestone May 24, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.8 May 25, 2021
@wtgodbe
wtgodbe merged commit 707896a into release/5.0 Jun 1, 2021
@wtgodbe
wtgodbe deleted the smit/LineBreak branch June 1, 2021 21:57
@ajcvickers ajcvickers removed this from the 5.0.8 milestone Jul 11, 2021
@dougbu dougbu added this to the 5.0.x milestone Oct 5, 2021
@AndriySvyryd AndriySvyryd removed this from the 5.0.x milestone Nov 17, 2021
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.

7 participants