Skip to content

load extensions using the C API instead of SQL #170

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

Merged
merged 1 commit into from
Jan 27, 2015

Conversation

tajtiattila
Copy link
Contributor

This fixes the problem of loading ICU, which needs to replace existing
functions. Replacing existing functions are prohibited when a VM
is running.

I found this problem on Windows x64, debugged by extending icu.c such that it returns a text message.

Another benefit of this change is that the SQL load_extension() function always returns NULL, but
now it is possible to examine the actual return value.

This fixes the problem of loading ICU, which needs to replace existing
functions. Replacing existing functions are prohibited when a VM
is running.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.23%) to 84.01% when pulling 0486dee on tajtiattila:master into a141177 on mattn:master.

@tajtiattila
Copy link
Contributor Author

Note that the use of C.sqlite3_load_extension() might not be absolutely necessary: I haven't fully checked, but the SELECT load_extension... might still work without using a prepared statement
(i.e. use conn.Exec directly). Let me know if this should be checked.

I've verified that the calls to C.sqlite3_enable_load_extension() are still necessary. This observation corresponds to the sqlite documentation.

mattn added a commit that referenced this pull request Jan 27, 2015
load extensions using the C API instead of SQL
@mattn mattn merged commit 25d045f into mattn:master Jan 27, 2015
@mattn
Copy link
Owner

mattn commented Jan 27, 2015

Thank you

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 this pull request may close these issues.

3 participants