FTS detection treats table names as LIKE patterns
维护者通常 3 天内回复
评估
调研方向
先阅读 detect_fts() 及其用于查找 FTS 表的 LIKE 模式;issue 指出表名通配符处理是原因。用提供的 book_titles 和 bookXtitles 示例重现问题,然后检查是否有回归测试覆盖 _ 和 %。检测到 book_titles_fts,且搜索 incorrect 不返回任何行,即为完成。
由索引模型根据 Issue 内容生成。
描述
When a table name contains _ or %, detect_fts() treats those characters as SQL LIKE wildcards. It can select another table's FTS index and use its matching row IDs against the requested table.
from sqlite_utils import Database
db = Database(memory=True)
db["bookXtitles"].insert({"title": "incorrect"}).enable_fts(["title"])
db["book_titles"].insert({"title": "correct"}).enable_fts(["title"])
print(db["book_titles"].detect_fts())
print(list(db["book_titles"].search("incorrect")))
Current main prints bookXtitles_fts and returns the row containing correct, even though that row does not match the search. It should detect book_titles_fts and return no rows for this query.
The same issue occurs with % in the table name. The table-name portion of the LIKE patterns needs escaping. The quote delimiters added for #434 prevent prefix matches but leave wildcard characters active.
Reproduced on Python 3.12 and SQLite 3.53.1 using current main.
- 主要语言
- Python
- 星标
- 2.2k
- 派生
- 215
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
simonw/sqlite-utils 的其他 Issue
-
Contributing docs: local test runs silently skip SpatiaLite and ext.c tests, and the setup steps assume SSH and uv可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
simonw/sqlite-utils#928 ·
维护者通常 3 天内回复
-
Tests use CliRunner.isolated_filesystem(), which is deprecated and will be removed in Click 9.0可能已有人在做 @devpryan7792 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
simonw/sqlite-utils#916 ·
维护者通常 3 天内回复
-
rows_from_file() splits a single-column CSV file on a letter, or raises csv.Error可能已有人在做 @L4XB 于 20 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
simonw/sqlite-utils#907 ·
维护者通常 3 天内回复
-
enable_fts() exhausts iterator columns before populating the index可能已有人在做 @syahra712 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
simonw/sqlite-utils#902 ·
维护者通常 3 天内回复
-
rows_from_file() ignores ignore_extras= and extras_key= for anything that isn't Format.CSV可能已有人在做 @feiiiiii5 于 37 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
simonw/sqlite-utils#892 ·
维护者通常 3 天内回复
查看 simonw/sqlite-utils 的全部 Issue
相似的 Issue
-
Remove the `pull_request_target` workflow before GitHub blocks it可能已有人在做 @jat255 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
IBM/mcp-context-forge#7483 ·
维护者通常 2 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 78/100
-
[Bug Report]: OpenAI 辅助 API 连通性测试因输出上限仅 1 token 误报“未知错误”可能已有人在做 @fjfanjian 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
Project-N-E-K-O/N.E.K.O#3640 ·
维护者通常 1 天内回复
-
author-page correction
难度 2/5 1-3 小时 新手友好度 64/100
acl-org/acl-anthology#10808 · 1 条评论 ·
维护者通常 1 天内回复