-
Notifications
You must be signed in to change notification settings - Fork 109
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
sqlite3_load_extension not working #532
Comments
In trying to diagnose #523 I discovered that load_extension is enabled only for the dynamic provider. See this comment: At the time, I didn't understand how you had not run into this problem already, because, IIRC, the main reason I added support for load_extension was for spatialite use cases at your request. May I assume this would explain the problem you are seeing? |
… for other provider configurations, likely to help with #532
If my diagnosis is correct, pre-release 2.1.4-pre20230105221937 should contain a fix. |
I tested this locally with Microsoft.Data.Sqlite 7.0.1. I first ran it normally with normal Microsoft.Data.Sqlite 7.0.1, and it failed as expected. Then I replaced So it seems like your fix was correct. |
Not catching this is totally on me. I made all the code changes, and our automated tests passed, so I ultimately merged the changes. After customers reported issues, I discovered that because of issues on Linux and macOS, our EF tests just get skipped when SpatiaLite can't be loaded, and I didn't notice they were suddenly being skipped on Windows too. The M.D.SQLite tests also just assert that the exception you get when trying to load an extension is different than when extensions are disabled. So, it just slipped through a big hole in our test coverage and verification. |
Ah. Well, I had opportunities to avoid this problem as well. I'm just glad the mystery is solved. I'll plan a 2.1.4 probably early next week. |
2.1.4 is now on nuget.org |
We're seeing issues loading mod_spatialite in dotnet/efcore#29584. It looks like a problem with the
sqlite3_load_extension
implementation.Here's a repro. ❗ Be sure to install mod_spatialite too.
If I use my own implementation, it works:
The text was updated successfully, but these errors were encountered: