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

ODBC driver version (1.0.0) had an issue on windows server (2019 at least) whereas v0.10.3 works fine #24

Open
rferraton opened this issue Jul 10, 2024 · 6 comments

Comments

@rferraton
Copy link

We had an issue with the odbc drivers v1.0.0 on windows server only (tested on windows server 2019 only).
The odbc driver work fine on windows 11 desktop
The odbc driver v0.10.3 works correctly on the windows server where we had the issue with the v1.0.0.

No data returned, nor error with the v1.0.0.
We use the DuckDB DSN in a OPENROWSET() command in SQL Server queries

@maiadegraaf
Copy link
Collaborator

Thanks for the issue, could you add more reproducible code? Which application are you using to access the driver?

@rferraton
Copy link
Author

I use SQL Server to access DuckDB DSN

with a linked server named DUCK and a query like that

SELECT * FROM OPENQUERY(DUCK,'SELECT version() versduck');

or directly using OPENROWSET

SELECT * FROM OPENROWSET('MSDASQL','DSN=DuckDB','select version() versduck');

On windows 2019 : return v0.10.3 (when working), never return when using V1.0.0 ODBC Drivers.
On windows 11 : return v1.0.0 on my laptop when using v1.0.0 odbc driver of course :-) ...

@teklinp
Copy link

teklinp commented Aug 29, 2024

I have the same problem on Windows 10. The 0.10.3 works, but 1.0.0 does not. Initially, I encountered it in Excel Power Query. I have also tried Python using pyodbc:

import pyodbc
con = pyodbc.connect('Driver=DuckDB Driver')
cur = con.cursor()
cur.execute('select version()')
cur.fetchone()

0.10.3 returns:

('v0.10.3',)

1.0.0 fails after second line:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.Error: ('HY000', 'The driver did not supply an error!')

If I remember correctly, there was an initial 1.0.0 version of ODBC driver released on Jun 3 which worked fine. The current version released on Jun 27 does not work.

@mtslaugh
Copy link

Having the same problem with DuckDB version 1.1.0 on Windows server 2016 version 10.0.14393.

Testing the DuckDB odbc driver with R:

library(odbc)
library(DBI)

con <- dbConnect(odbc::odbc(), dsn = "DuckDB")

This crashes R.

Testing from the CLI:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\XXXXXXX> cd test/duckdb_cli

C:\Users\XXXXXXX\test\duckdb_cli>duckdb
v1.1.0 fa5c2fe15f
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D SELECT version() versduck;

C:\Users\XXXXXXX\test\duckdb_cli>

Fails silently and returns to the host.

@carlopi
Copy link
Contributor

carlopi commented Sep 12, 2024

Thanks for reporting.

This has likely the same root cause as duckdb/duckdb#13848, and the problem is on how we built Windows build artifacts.

A workaround and more details are at duckdb/duckdb#13848 (comment).
If you want to check the workaround, it's:

I upgraded to the latest one from https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 and the problem went away.

We need to iterate in a few places to fix this, we'll come back when a proper solution is up.

@mtslaugh
Copy link

Confirmed that the workaround (installing the latest Visual C++ Redistributable) solved this issue for me. I was previously running version 14.28.29325 and upgraded to version 14.40.33810.

DuckDB is working from both CLI and ODBC now.

Thanks!

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

5 participants