Hello, first of all, thanks for creating this great project. I've been experimenting with this new library and testing some code I use to execute stored procedures. I'm having trouble when passing an argument to the stored procedure containing more than 16384 characters or bytes.
Describe the bug
When passing an argument of the ASE type image or text to the stored procedure I get the following error from the ASE server when the argument contains a string or byte array larger than 16384 characters/bytes:
The token datastream length was not correct. This is an internal protocol error.
This works with the Sybase.AdoNet4.AseClient library version 4.157.1300.
To Reproduce
Create a stored procedure that accepts a text argument:
create or replace procedure [dbo].[sp_test_text_type]
@input text,
@output int output
as
begin
set @output = len(@input)
end
C# code:
using (var connection = new AseConnection(connectionString))
{
connection.Open();
using (var command = connection.CreateCommand())
{
command.CommandText = "sp_test_text_type";
command.CommandType = CommandType.StoredProcedure;
var input = new string('a', 20000);
var pIn = command.CreateParameter();
pIn.ParameterName = "@input";
pIn.Value = input;
pIn.AseDbType = AseDbType.Text;
command.Parameters.Add(pIn);
var pOut = command.CreateParameter();
pOut.ParameterName = "@output";
pOut.Value = DBNull.Value;
pOut.DbType = DbType.Int32;
pOut.Direction = ParameterDirection.Output;
command.Parameters.Add(pOut);
command.ExecuteNonQuery();
}
}
Hello, first of all, thanks for creating this great project. I've been experimenting with this new library and testing some code I use to execute stored procedures. I'm having trouble when passing an argument to the stored procedure containing more than 16384 characters or bytes.
Describe the bug When passing an argument of the ASE type
image
ortext
to the stored procedure I get the following error from the ASE server when the argument contains a string or byte array larger than16384
characters/bytes:The token datastream length was not correct. This is an internal protocol error.
This works with the Sybase.AdoNet4.AseClient library version 4.157.1300.
To Reproduce Create a stored procedure that accepts a text argument:
C# code:
Debug output:
A solution to get the above sample working is changing
pIn.AseDbType = AseDbType.Text;
to:pIn.DbType = DbType.String;
This results in 40000 bytes sent to the server with UserType 36:
and no error. I'm unable to create a similar solution for the image type.
Expected behavior Using the old Sybase .Net Framework library this results in the output argument returning 20000.
Environment
.Net Framework 4.8
and.Net Core 3.1
AdoNetCore.AseClient
nuget package version0.19.2
Adaptive Server Enterprise/16.0 SP03 PL08/EBF 28921
iso_1
Additional context If wanted, I can also provide a sample for the image type bug using a byte array.