Skip to content

Poco:Data::ODBC - MSSQL (n)varchar(max) length issue #4324

@Spaky

Description

@Spaky

Describe the bug
The data binding of (n)varchar(max) field in Poco:Data::ODBC seems just to allow max 8000 bytes, but MSSQL Server allow allows up to 2^31-1 bytes.

To Reproduce
Create a table with a varchar(max) or nvarchar(max) field, insert data with more then 8000 byte.

Expected behavior
I should be possible to insert data with more then 8000 bytes when SQL datatype is (n)varchar(max).

Logs
INSERT failed: exception: 'class Poco::Data::LengthExceededException' what: 'Data too long' message: 'Error binding column 6 size=67150, max size=8000)'

Please add relevant environment information:

  • Windows 10, Windows Server 2019
  • POCO Version: 1.12.4
  • MS SQLServer 2019

Additional context
I think the retrieving of the type info of the DB needs a special handling for (n)varchar(max).

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions