File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13093,9 +13093,9 @@ bool writeDataSizeToSnapshot
1309313093 );
1309413094 charsLeft = len;
1309513095
13096- // If total length is known up front, the length isn't specified as unknown
13097- // and the caller doesn't pass int.max/2 indicating that it doesn't know the length
13098- // allocate the whole buffer in one shot instead of realloc'ing and copying over each time
13096+ // If total data length is known up front from the plp header by being not SQL_PLP_UNKNOWNLEN
13097+ // and the number of chars required is less than int.max/2 allocate the entire buffer now to avoid
13098+ // later needing to repeatedly allocate new target buffers and copy data as we discover new data
1309913099 if (buff == null && stateObj._longlen != TdsEnums.SQL_PLP_UNKNOWNLEN && stateObj._longlen < (int.MaxValue >> 1))
1310013100 {
1310113101 if (supportRentedBuff && stateObj._longlen < 1073741824) // 1 Gib
You can’t perform that action at this time.
0 commit comments