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
## Why make this change?
We have recently noticed that, if we have a column of type NVARCHAR or
VARCHAR and we try to run a stored procedure that reads a row in which
that column has an empty string value, we had an internal server error.
This error happens when we try to run the method GetChars passing in a
buffer with length 0
This PR aims to fix this problem
## What is this change?
We have added a small change to the method that was throwing the
exception.
If we find that resultFieldSize is 0 - which means that the data in the
cell we are reading has a length of 0 - we will not call the method
GetChars to read the data, but assume the data is empty and return the
size of the data read in bytes as 0.
As you can see in the example bellow, that fixes the issue.
## How was this tested?
- [x] Integration Tests
- [x] Unit Tests
## Sample Request(s)
We have a table with a column of type NVARCHAR called "Description". In
one of the rows, Description is an empty string
<img width="2258" height="494" alt="image"
src="https://github.com/user-attachments/assets/857b9d93-e1e1-4c4b-b802-70693037402e"
/>
**Before the changes:**
If we try to run a stored procedure that reads that empty cell, we get
an error
<img width="2783" height="1245" alt="image"
src="https://github.com/user-attachments/assets/adc80578-2532-4f71-b781-f4bee8798334"
/>
**After changes**
Stored procedure runs as expected
<img width="2776" height="1214" alt="image"
src="https://github.com/user-attachments/assets/bd4e0e2d-de34-4a20-8805-7a676f40de15"
/>
---------
Co-authored-by: Giovanna Ribeiro <[email protected]>
Co-authored-by: RubenCerna2079 <[email protected]>
0 commit comments