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 compile docs possibly out of date? #43

Closed
2 tasks done
kkovacs opened this issue Dec 10, 2024 · 4 comments · Fixed by #45
Closed
2 tasks done

ODBC compile docs possibly out of date? #43

kkovacs opened this issue Dec 10, 2024 · 4 comments · Fixed by #45

Comments

@kkovacs
Copy link

kkovacs commented Dec 10, 2024

What happens?

(Moved from duckdb/duckdb#15189)

Hi fellow Ducks,

first of all, thanks for the incredible job you are doing with DuckDB!

TLDR: I don't seem to be able to compile a functioning ODBC driver. Please advise.

I'd like to have a look into issue duckdb/duckdb#11380 , "ODBC Driver doesn't handle path to database correctly", because it's a blocking issue for us too.

I wanted to compile the ODBC drivers on Linux first, but turns out it's not as easy as I thought - I would need some pointers. Maybe the instructions are outdated, or maybe I'm just thick headed :)

(Also, the ODBC downloads are behind the "normal" DuckDB versions (1.1.0 vs 1.1.3), so maybe there is some problem momentarily?)

To Reproduce

First attempt

So, in the https://github.com/duckdb/duckdb-odbc repository, the README.md starts with:

Build the ODBC client (from within the main DuckDB repository)
BUILD_ODBC=1 DISABLE_SANITIZER=1 make debug -j

I assumed that the "main DuckDB repository" is the https://github.com/duckdb/duckdb one, but running the above command there does NOT produce a libduckdb_odbc.so file, which would be the ODBC driver.

$ find . -name '*.so'
./build/debug/tools/sqlite3_api_wrapper/libsqlite3_api_wrapper.so
./build/debug/src/libduckdb.so

No libduckdb_odbc.so.

Second attempt

Apparently the https://github.com/duckdb/duckdb-odbc repo is regularly updated ("vendored") from the https://github.com/duckdb/duckdb repo (although strangely, the mentioned hashes are not found in the original repo):

ed948a5  32 hours ago DLGBot          o Update vendored DuckDB sources to 73b56c6
73b56c6    2 days ago DLGBot          o Update vendored DuckDB sources to 091af07
091af07    3 days ago DLGBot          o Update vendored DuckDB sources to 268b4b6

So I tried to run the following in the https://github.com/duckdb/duckdb-odbc repo next:

BUILD_ODBC=1 DISABLE_SANITIZER=1 make release -j 4

This does produce a libduckdb_odbc.so, but when I try to use it, I get the following error, indicating that somehow the compile is not "complete", it misses "core" features:

$ ./linux_setup/unixodbc_setup.sh -u -D ~/duckdb-odbc/build/release/libduckdb_odbc.so

$ echo "select version();" | isql -v DuckDB
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| echo [string]                         |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select version();
[37000]ODBC_DuckDB->PrepareStmt
Catalog Error: Scalar Function with name "version" is not in the catalog, but it exists in the core_functions extension.

Please try installing and loading the core_functions extension by running:
INSTALL core_functions;
LOAD core_functions;

Alternatively, consider enabling auto-install and auto-load by running:
SET autoinstall_known_extensions=1;
SET autoload_known_extensions=1;
[ISQL]ERROR: Could not SQLPrepare

Basically nothing works, since "core_functions" does not seem to be compiled in.

The suggested INSTALL/LOAD does not work either (but I'm pretty sure this should not be needed anyway, core should probably be built in...):

SQL> INSTALL core_functions;
SQLRowCount returns -1
SQL> LOAD core_functions;
[S1000]ODBC_DuckDB->SingleExecuteStmt
IO Error: Extension "/home/user/.duckdb/extensions/aa3787b0c1/linux_amd64/core_functions.duckdb_extension" could not be loaded because its signature is either missing or invalid and unsigned extensions are disabled by configuration (allow_unsigned_extensions)
[ISQL]ERROR: Could not SQLExecute

Please advise! :)

OS:

Linux, Ubuntu 24.04

DuckDB Version:

latest

DuckDB Client:

latest

Hardware:

Linux 5.15.0-126-generic duckdb/duckdb#136-Ubuntu SMP Wed Nov 6 10:38:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Full Name:

K Kovacs

Affiliation:

Priority Queue Consulting

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

Did you include all relevant data sets for reproducing the issue?

Not applicable - the reproduction does not require a data set

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have
@szarnyasg szarnyasg transferred this issue from duckdb/duckdb Dec 10, 2024
@szarnyasg
Copy link
Contributor

Hi, I have to step out in 1 minute, so just a quick pointer: I moved the issue to the ODBC repository. Please consult the README and the GitHub Actions job in this repository. I'll get back with a more detailed answer later.

@kkovacs
Copy link
Author

kkovacs commented Dec 10, 2024

Thank you, Gábor! I did look into the .github actions/workflows, but apparently that also ultimately does make release too (after installing dependencies, which I also did, although manually).

@guenp
Copy link
Collaborator

guenp commented Dec 10, 2024

Building the latest version does not work currently: #41

@kkovacs
Copy link
Author

kkovacs commented Dec 11, 2024

Thanks @guenp, confirmed, it compiles now!

Now let's see if I can actually fix the issue I meant to... :)

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 a pull request may close this issue.

3 participants