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

Add SQL Server test for the Invalid Descriptor Index issue #227

Merged

Conversation

@mloskot
Copy link
Member

mloskot commented Nov 25, 2019

What does this PR do?

Attempt to clarify nanodbc behaviour regarding ODBC restriction called
out of order retrieval of unbound (variable-length) columns which
are based on calls to SQLGetData.

What are related issues/pull requests?

This is also illustration to r-dbi discussions at
r-dbi/odbc#86
r-dbi/odbc#309

Tasklist

  • Add test case(s)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed

Environment

Provide environment details, if relevant:

  • DBMS name/version: SQL Server
Attempt to clarify nanodbc behaviour regarding ODBC restriction called
out of order retrieval of unbound (variable-length) columns which
are based on calls to SQLGetData.

This is also illustration to r-dbi discussions at
r-dbi/odbc#86
r-dbi/odbc#309
@mloskot mloskot force-pushed the mloskot:ml/add-test-for-out-of-order-unbounds branch from 546c1fb to c3b4356 Nov 25, 2019
Copy link
Contributor

lexicalunit left a comment

Sweet, nice to have a test for this.

@mloskot mloskot added this to Done in Release 2.13 Nov 25, 2019
@mloskot mloskot added this to the 2.13 milestone Nov 25, 2019
@mloskot mloskot merged commit b05c4d4 into nanodbc:master Nov 25, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mloskot mloskot deleted the mloskot:ml/add-test-for-out-of-order-unbounds branch Nov 25, 2019
@jimhester

This comment has been minimized.

Copy link
Contributor

jimhester commented Nov 25, 2019

So one potential workaround for this issue would be

  • check if the driver does not support SQL_GD_ANY_COLUMN
  • AND there is a long column before non-long columns in the result

Then do not bind any columns after the long column and just use SQLGetData() on them directly without binding.

This wouldn't require any reordering / rewriting of the original query. Performance would suffer, but could be rescued if the query was rewritten by the user application or use of drivers which did support SQL_GD_ANY_COLUMN.

The main issue I think is that the nanodbc code assumes all columns are bound, so it may take a decent amount of rewriting to support this idea...

@mloskot

This comment has been minimized.

Copy link
Member Author

mloskot commented Nov 26, 2019

@jimhester Good summary, thanks. I've taken the liberty to move this discussion to new thread at #228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Release 2.13
  
Done
3 participants
You can’t perform that action at this time.