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

SQL_DATA_AT_FETCH & using the ARD's SQL_DESC_OCTET_LENGTH_PTR field for input #99

Closed
matthew-wozniczka opened this issue Feb 16, 2017 · 1 comment
Assignees

Comments

@matthew-wozniczka
Copy link
Contributor

matthew-wozniczka commented Feb 16, 2017

Related to #98, the current implementation of SQL_DATA_AT_FETCH requires the driver to use the length indicator for input when fetching. This is a new requirement in ODBC 4.0, which will cause backwards compatibility issues.

Consider that in the past, when fetching data, the length indicator was output-only. This means that the application was not required to initialize the memory it pointed to. This means that it could inadvertently contain the value SQL_DATA_AT_FETCH, and cause the fetch to be interrupted (where the application may not be prepared for such a thing). Of course, such an application is likely using an earlier ODBC version for SQL_ATTR_ODBC_VERSION, but it could cause ('random') problems for applications which were upgraded.

This brings up a more fundamental point: If the application does not wish to bind the column as SQL_DATA_AT_FETCH, what value should the length indicator buffer be initialized to?

@mikepizzo mikepizzo self-assigned this Apr 25, 2017
@mikepizzo
Copy link
Contributor

I believe this ended up being resolved as part of issue #98.

Applications that specify odbc version 4.0 or greater will need to make sure the buffers are initialized to some value other than SQL_DATA_AT_FETCH (typically, SQL_DATA_UNAVAILABLE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants