-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Test_sqlite3 failing with SQLite 3.49.0 #129870
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
Comments
This comment has been minimized.
This comment has been minimized.
I believe sqlite3 in Python used to be a separate project that was incorporated into the stdlib, but not sure if it is still maintained independently or now by the core Python team. I've only ever used fts5, and I have no idea why anyone would still want to use the older versions, but Chesterton's Fence applies, and we should not break things gratuitously. |
The people involved in #64662 would seem like the best ones to ask. I don't think sqlite3 has any specific fts support, it was just using fts4 as a way to create a virtual table to test dumping it. I am not sure what other extension is always included and can generate a virtual table for the test. FTS5 is not automatically built either. |
Hi @fazalmajid, Thanks for your insights! It makes sense to be cautious before switching to FTS5 if it’s not automatically built either. Given that FTS4 was used primarily for creating a virtual table in the test, do you think we should explore an alternative extension that is always included for generating the virtual table? Also, I’ll check issue #64662 to see if we can get input from those involved there. If there are any other considerations before making changes, I’d love to understand them. Looking forward to your thoughts! Thanks again! |
I can't find anything referrencing this in the sqlite3 changelog. Could it be a local issue? Note that FTS3/4 are still supported by sqlite3 so I don't think it's because it was superseded (they are still maintained and not indicated as superseded; note that FTS3 and 4 come by pair according to https://www.sqlite.org/fts3.html#compiling_and_enabling_fts3_and_fts4). AFAIR, there are few built-in virtual tables enabled by default. JSON support is by default enabled as of SQLite 3.38 (https://www.sqlite.org/json1.html#compiling_in_json_support) but can be disabled. So we could use the Now, since we don't ship our own copy of sqlite3, I think we only rely on a pre-compiled sqlite3 lib. So, we may not have that one either. An alternative is to first check which ones are available, and if none is, then we skip the test (because that means we can't use vtables as well!). Modules can be listed via @erlend-aasland As the current sqlite3's maintainer, what can we do on our side now? |
This comment has been minimized.
This comment has been minimized.
Footnotes |
I agree with the approach of testing for extension presence. As for the local build issue, I have SQLite built using:
Here is the diff between the output of
|
Fazal:
FTS5 is a breaking change from FTS4; see the SQLite docs for more details. |
Yep, I'm that old. In fact, I am an old enough Python user that I was one of the people who voted to establish the comp.lang.python Usenet newsgroup back in 1994 |
Oh, yes, I'm sorry but I always forget about them :') Let me rephrase it as "Now, since on Linux, we don't ship the library but use the system-wide if any" [...]. I knew the difference but I thought that macOS had packages for that (though I totally forgot about Windows). By the way, I said "sqlite3" because of the name of the library that is |
Fazal:
Cool, and thanks for sharing :) Let's solve this by skipping the test if FST4 is not available. Feel free to beat me with a PR to fix this. |
Yes, but Python or the sqlite3 module do not actually use either FTS4 or FTS5. The only place either are referenced is the Mac installer (which builds both) and test_dump.py, which only uses FTS4 to create a virtual table. Neither FTS4 nor FTS5 can be assumed to be present in the system-wide SQLite. It would be a bad idea to vendor SQLite in Python as the system may have additional extensions like encryption. Thus picnixz's approach of testing known virtual table extensions seems the soundest to me. |
Yes, but as you pointed out, that won't work on Linux, or BSD, or Solaris, etc. |
I'm not on my dev session, so feel free to do it. Is there a simple way to detect if |
We could just try each module in turn until one manages to create the virtual table. I tried naively doing a I'm currently travelling to India due to a family medical emergency, with abysmal connectivity, I'd be happy to submit a PR next week when I am back in London. Likely the first ones to notice will be Linux distros like Alpine, or people crazy enough to rebuild their entire stack from source like myself. |
No, that would be too fragile. The dump can vary too much between the various virtual tables. |
No worries, I made a quick PR that autodetects features and skips the test if needed. I may also update the PR to use FTS5 iso. FTS4. |
…upport (pythonGH-129913) (cherry picked from commit cda83ca) Co-authored-by: Erlend E. Aasland <[email protected]>
Thanks for the report, @fazalmajid, and thanks for your input, @picnixz! |
…support (GH-129913) (#129918) (cherry picked from commit cda83ca) Co-authored-by: Erlend E. Aasland <[email protected]>
Bug report
Bug description:
test_sqlite3/test_dump.py relies on fts4 for
test_dump_virtual_tables
. However, SQLite 3.49.0 apparently no longer builds withENABLE_FTS4
by default, presumably because it was superseded by FTS5. This causes this unit test to fail.CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: