Repository navigation
Detect FTS tables with unquoted or single-quoted content= - #3011
Merged
Merged
Conversation
…onw#1991 detect_fts() only matched content="table" and content=[table], so an FTS table created with content=captions (the form used in the SQLite FTS5 docs), content='captions' or content=`captions` was not detected: the table page had no search box and ?_search= was silently ignored. When the existing LIKE query finds nothing, fall back to parsing the content= option with _fts_external_content_table(), the same helper the derived table permission code already uses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3011 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 78 78
Lines 13371 13376 +5
=====================================
- Misses 13371 13376 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1991
detect_fts()only recognised FTS tables declared withcontent="table"orcontent=[table]. SQLite also acceptscontent=table(the form used in the FTS5 docs),content='table'andcontent=`table`. With any of those, the table page shows no search box and?_search=is silently ignored, so it returns every row.The hiding half of #1991 is already fixed on main, because
sqlite_hidden_table_names()now parses the DDL. This handles the detection half. When the existing LIKE query finds nothing,detect_fts()parses thecontent=option with_fts_external_content_table(), the same helper the derived-table permission code uses. Aninstr()check limits the parsing to FTS declarations that mention the table name, so the extra cost stays small on databases with many tables.I added the three quoting styles to the existing
test_detect_ftsparametrization, plus a check that a table whose name is a prefix of the content table (Street_TreevsStreet_Tree_List) isn't matched.I used Claude Code to write this change.