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

Check errors while reading data #130

Merged
merged 1 commit into from
Oct 30, 2020
Merged

Check errors while reading data #130

merged 1 commit into from
Oct 30, 2020

Conversation

jgoizueta
Copy link

We didn't check for errors from SQLGetData calls.

@jgoizueta jgoizueta requested a review from Algunenano October 22, 2020 15:49
Copy link

@Algunenano Algunenano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this come from any bug? Is it something that we can reproduce with a test?

@jgoizueta
Copy link
Author

It comes from a situation where we were ignoring errors, and that could lead to segfaults:
The SQL Server driver, unlike others doesn't support converting binary data to text (as hex strings). It complained when asked to do so with an error result from SQLGetData, but it also seems to modify the read buffer. Since we were ignoring the problem we then used the buffer as an hex string into a bytea field and occasionally got Segfaults (which in my opinion would never occur if SQLGetData failing calls had avoided modifying the buffer, but well...)

I don't think that's easy to find a good test case: We could use a binary field with the SQL Server driver, buts that's something I'd like to have fixed soon. So we need a column type that we don't ignore but the driver cannon convert to text.

@jgoizueta jgoizueta merged commit 8968533 into master Oct 30, 2020
@jgoizueta jgoizueta deleted the getdata-errors branch October 30, 2020 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants