GNU bug report logs -
#63590
29.0.90; can't load sqlite extension
Previous Next
Full log
Message #14 received at 63590 <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 19 May 2023 15:25:21 +0200
> From: Lennart Vogelsang via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> To reproduce, I've created an empty folder, cd'ed into it, started
> emacs -Q, copied the sqlite's csv extension source code [0] into
> csvtable.c,
> compiled it with
>
> gcc -O3 -Wall -Wno-unknown-pragmas -fPIC -shared -lm -o
> csvtable.so csvtable.c
>
> and executed the following elisp forms in the scratch buffer:
>
> (setq-local mydb (sqlite-open))
> (sqlite-load-extension mydb "./csvtable.so")
>
> I get a nil return value from the second expression, indicating
> that it did not load the extension (verified by using the `csv` module
> in a `sqlite-execute` call). If I try the same from the `sqlite3` cli
> interface, it works:
>
> .load ./csvtable.so
I think you made one more change to csv.c: you renamed the function
sqlite3_csv_init to the name sqlite3_csvtable_init. Otherwise, the
loading would fail, because sqlite3's cli will not find the entry
function it expects.
More importantly: the csv.c source file to which you point, viz.:
https://www.sqlite.org/src/artifact?ci=trunk&filename=ext/misc/csv.c
is NOT the source file of the libsqlite3_mod_csvtable.so extension
distributed by Debian, which we currently have on the "allow list", it
is a different extension. The source of csvtable is here:
https://packages.debian.org/sid/libsqlite3-mod-csvtable
This bug report was last modified 2 years ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.