-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[5.0.2] Migrations: Generate valid SQL when escaping new lines in seed data #23634
Conversation
82a07d7
to
04b6175
Compare
src/EFCore.Sqlite.Core/Storage/Internal/SqliteStringTypeMapping.cs
Outdated
Show resolved
Hide resolved
src/EFCore.SqlServer/Storage/Internal/SqlServerStringTypeMapping.cs
Outdated
Show resolved
Hide resolved
04b6175
to
de67a7b
Compare
Updated. |
src/EFCore.Sqlite.Core/Storage/Internal/SqliteStringTypeMapping.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Sqlite.Core/Storage/Internal/SqliteStringTypeMapping.cs
Outdated
Show resolved
Hide resolved
de67a7b
to
5342c63
Compare
Approved by Tactics for 5.0.2. |
5342c63
to
b5c0592
Compare
Using CONCAT for strings is not so good due to string truncation to 4000 chars in SQL server :-( Here are some resources for this SQL server behavior: Is there any workaround for this? We have had CSHTML templates in seed data and now it would not be posible in new version of .net? |
Resolves #23518
Resolves #23459
Description
We fixed a bug in EF Core 5.0 to preserve the formatting of seed data with embedded new lines: #20662. The fix involves using the SQL
concat
function, but this was done in a way that creates an unbalanced tree in the SQL which then fails in both SQL Server and SQLite for large amounts of data.Customer Impact
Migrations of EnsureCreated with large, multi-line strings in seed data throw. The only workarounds are to remove the seed data and get it to the database some other way, or to strip out the newlines.
How found
Customer reported on 5.0.0 for both SQL Server and SQLite
Test coverage
We have added test coverage to ensure the tree is created in balanced way.
Regression?
Yes, from 3.1.
Risk
Low. Doesn't fundamentally change anything except the balancing of the tree. Quirked.