Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix case when SQLGetData data size exceeds column size (#346)
* Fix case when SQLGetData data size exceeds column size Fixes #328. Ok, a bit nasty, but here's the rundown: * This is mostly outlined [here](https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetdata-function?view=sql-server-ver16#retrieving-data-with-sqlgetdata) * The issue is that for our result set, the cursor may be told that a give column has a certain size in bytes, particularly for variable-sized columns like VARCHAR * BUT, the driver then may have to "convert to the target type" and this conversion may result in the _actual_ data size being larger than we orignally allocated for * But wait, you may ask, don't we already account for this case [here](https://github.com/JuliaDatabases/ODBC.jl/blob/f38f771557a5763f777ed0f441c2cc5a72f41c70/src/utils.jl#L328) by resizing the buffer and calling SQLGetData again to retrieve the rest of the data? * Why yes, we do, but only for "long" data types, which is the primary use case for the multiple SQLGetData calls * So basically this is _another_ case where, totally depending on the db driver, we might end up with truncated data which will result in `API.SQL_SUCCESS_WITH_INFO` being returned from SQLGetData Thankfully the fix is relatively easy: we just need to use our buffer-resizing branch if the data type is long OR SQLGetData returns this success with info status code. * bump some versions and update ci
- Loading branch information
a7ce136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
a7ce136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/66084
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: