You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrations that insert large strings that contain newlines are truncating the string due to improper use of CONCAT.
The first CONCAT (the most outer one), correctly casts its first argument to nvarchar(max). However, the subsequent nested CONCAT calls do not do this, causing them to be silently truncated.
For the repro below, I'd expect the database to contain a string with length 10000 (10 chars per line, 1000 lines). Instead, the length of the string in the database is only 5296 characters. There is no error or warning.
The size of the resulting string maxes out at lengthOfOutermostConcatChunk + 4000.
Migrations that insert large strings that contain newlines are truncating the string due to improper use of
CONCAT
.The first
CONCAT
(the most outer one), correctly casts its first argument tonvarchar(max)
. However, the subsequent nestedCONCAT
calls do not do this, causing them to be silently truncated.For the repro below, I'd expect the database to contain a string with length 10000 (10 chars per line, 1000 lines). Instead, the length of the string in the database is only 5296 characters. There is no error or warning.
The size of the resulting string maxes out at
lengthOfOutermostConcatChunk + 4000
.Include your code
Include verbose output
Output of
dotnet ef migrations script --verbose > migration.sql
Include provider and version information
EF Core version: 6.0.1
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: (e.g. .NET 5.0) .NET 6
Operating system: Win 10
IDE: (e.g. Visual Studio 2019 16.3) VS 2022
The text was updated successfully, but these errors were encountered: