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

Cannot set configuration options in connection string when DRIVER name is specified #56

Open
staticlibs opened this issue Feb 3, 2025 · 0 comments

Comments

@staticlibs
Copy link
Contributor

This problem was discovered while testing the fix to #29 (see details there in comments).

With the latest nightly the following works correctly:

print(pyodbc.connect("DSN=DuckDB;access_mode=read_only").cursor().execute("select current_setting('access_mode')").fetchone())
('read_only',)

But the following fails:

print(pyodbc.connect("DRIVER=DuckDB Driver;access_mode=read_only").cursor().execute("select current_setting('access_mode')").fetchone())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.InterfaceError: ('IM003', '[IM003] O\x00Ɗ\x00䒀䒀핼핼Ɗ\x00ࠠ픾픾Ɗ\x00ࠐ픾픾Ɗ\x00\x02\x00Ɗ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\uffff\uffff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00㾀㾀\x00\x00蕠蕠 틨틨Ɗ\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00 (0) (SQLDriverConnect); [IM003] O\x00Ɗ\x00䒀䒀핼핼Ɗ\x00ࠠ픾픾Ɗ\x00ࠐ픾픾Ɗ\x00\x02\x00Ɗ\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\uffff\uffff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00㾀㾀\x00\x00蕠蕠틨틨Ɗ\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00 (0)')
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

No branches or pull requests

1 participant