Skip to content

Conversation

@bpintea
Copy link
Collaborator

@bpintea bpintea commented Feb 8, 2022

The last parameter of SQLDescribeCol(), the "NumericAttributePtr" is an
out parameter that should always point to a SQLLEN value (for both x64
and x32 builds), despite this value being assigned different width
values.

The x32 API definition uses a "void *" that would allow passing pointers
to various width integers, but the spec does require an SQLLEN and other
drivers and apps aligned to it. Some apps seem however to not cast down
to the width corresponding to the various attributes, which can lead to
incorrect behavior. The driver now scales up all values to an SQLLEN.

Also, returning of the SQL_DESC_NUM_PREC_RADIX attribute is
corrected.

The last parameter of SQLDescribeCol(), the "NumericAttributePtr" is an
out paramter that should always point to a SQLLEN value (for both x64
and x32 builds), despite this value being assigned different width
values.

The x32 API definition uses a "void *" that would allow passing pointers
to various width integers, but the spec does require an SQLLEN and other
drivers and apps alligned to it. Some apps seem however to not cast down
to the width corresponding to the various attributes, which can lead to
incorrect behaviour. The driver now scales up all values to an SQLLEN.
Add unit tests for the SQLColAttribute() in connection with various
types of attributes queried.

Fix the value returned for SQL_DESC_NUM_PREC_RADIX attribute.
Replace explicit bit setting of attr value to be passed in to tested
function.
@bpintea bpintea merged commit b608f56 into elastic:master Feb 24, 2022
@bpintea bpintea deleted the fix/col_attrs_pnumattr branch February 24, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant