-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Avoid using double-quoted string literals in SQL queries #4709
Comments
Wow; thank you for pointing this out! This looks very serious. For a little more background on the issue, the SQLite docs discuss the syntax compatibility problem: Unfortunately, it is going to be tricky in general to track down where we are using this incorrect syntax. Based on the clue from this error message, suggesting that the sting literal in question is empty, I found one such instance: Line 274 in e51206a
That should be |
Unfortunately, |
I'm not a Python programmer and I find the namespace and pypi more confusing than dealing with any other languages repositories, but I came across this: https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.setconfig Which seems to expose the thing that's needed for this to work on FreeBSD. con.setconfig(sqlite3.SQLITE_DBCONFIG_DQS_DDL, 1)
con.setconfig(sqlite3.SQLITE_DBCONFIG_DQS_DML, 1) That should work on all version of sqlite3 if I'm reading the docs correctly. UPDATE: Of course, Nevermind, whatever is satisfying |
FreeBSD appears to have disabled DQS again as foretold. Is there any change I can locally apply to get my setup running again? Looks like the setconfig bits aren't it, yeah? |
The problem is likely that EDIT: I'll open a PR for this later. |
A quick look throughthe code I found the reference @sampsyo found, as well as the following 2 references in beets/dbcore/query.py. I am having trouble testing on windows running python 3.12.3, so looking to help out. I'll start a discussion about windows testing |
If you want to get things working locally on FreeBSD while this issue is still unresolved, you can build sqlite3 from ports with DQS enabled via |
@FST777 my system is using binary packages and I'm not a fan of mixing ports and packages. but that said, there is a less risky approach, turns out. I built a pyenv of python 3.12 last night, installed beets from git, and manually applied #5235 , setting the values to 1 instead. on freebsd 13.1, that magically got beets up and running again. |
Problem
With a default beets installation (via pkg or ports) on FreeBSD (13.1), any action requiring interaction with the SQLite database will cause beets to crash.
This is due to Double-quoted String Literals being disabled by default in the 3.41.0,1 version of SQLite - enabling DQS in the make options for the SQLite port corrects this issue and allows beets to complete database functions normally.
The maintainers of the SQLite port on FreeBSD have since re-enabled DQS by default but are planning to disable DQS by default no later than 20240101.
Running this command in verbose (
-vv
) mode:Led to this problem:
Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: