Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BinaryCodec uses varbinary which limits the byteArray to 65kb #99

Closed
SzalkaiGabor opened this issue Sep 18, 2019 · 0 comments
Closed

BinaryCodec uses varbinary which limits the byteArray to 65kb #99

SzalkaiGabor opened this issue Sep 18, 2019 · 0 comments
Labels
type: enhancement A general enhancement
Milestone

Comments

@SzalkaiGabor
Copy link

Hi,

I'd like to use byte[] to store files (around 2MB), however I got an exception like
Value 1087591 exceeds uShort.MAX_VALUE. The value of uShort.MAX_VALUE is 65535, and this limitation comes from
io.r2dbc.mssql.codec.BinaryCodec#encode -> io.r2dbc.mssql.codec.RpcEncoding#prepareBuffer.
The exception is thrown in io.r2dbc.mssql.message.tds.Encode#uShort.

Based on the discussion in https://gitter.im/R2DBC/r2dbc with @mp911de

We could conditionally use VARBINARY(MAX) or IMAGE (PLP-encoded stream) if the array size is greater than 65535
(Basically what BlobCodec does)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants