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
Describe the bug
When insert into 'Text' type column with bytecount of data < 16384 exception is thrown which it shouldn't
To Reproduce
Please provide C#/SQL necessary to reproduce the issue, and steps to follow:
SQL script for test table: create table [dbo].[test_text_table] (Fragment text not null, CreatedDate datetime default getdate() not null)
C# code
public void TextColumn_With_Data_Length_LessThan_16384_ReturnError()
{
using (var connection = new AseConnection(ConnectionStrings.Pooled))
{
using (var transaction = connection.BeginTransaction())
{
using (var fragmentCommand = connection.CreateCommand())
{
fragmentCommand.CommandText = "insert into test_text_table (Fragment) VALUES (@fragment)";
fragmentCommand.CommandType = CommandType.Text;
fragmentCommand.Transaction = transaction;
var fragment = new string('x', 4096);
var p = fragmentCommand.CreateParameter();
p.ParameterName = @"@fragment";
p.Value = fragment;
p.DbType = DbType.String;
p.Direction = ParameterDirection.Input;
fragmentCommand.Parameters.Add(p);
var status = fragmentCommand.ExecuteNonQuery();
transaction.Rollback();
}
}
}
}
Expected behavior
Should behave similar to the legacy driver where no exception occur.
Environment
.NET Framework and Core (All version)
AdoNetCore.AseClient nuget package version 0.18.0
Additional context
The way the driver determine the column data type for 'Text' is not reliable in particular using length {DbType.String, (value, length) => length <= 16384 ? TdsDataType.TDS_LONGBINARY : TdsDataType.TDS_BLOB}
The text was updated successfully, but these errors were encountered:
Describe the bug
When insert into 'Text' type column with bytecount of data < 16384 exception is thrown which it shouldn't
To Reproduce
Please provide C#/SQL necessary to reproduce the issue, and steps to follow:
SQL script for test table:
create table [dbo].[test_text_table] (Fragment text not null, CreatedDate datetime default getdate() not null)
C# code
Expected behavior
Should behave similar to the legacy driver where no exception occur.
Environment
AdoNetCore.AseClient
nuget package version 0.18.0Additional context
The way the driver determine the column data type for 'Text' is not reliable in particular using length
{DbType.String, (value, length) => length <= 16384 ? TdsDataType.TDS_LONGBINARY : TdsDataType.TDS_BLOB}
The text was updated successfully, but these errors were encountered: