Fix/1577 search special chars - #1578
Merged
Merged
Conversation
…yntax buildFuzzyQuery made one whole-query trust decision for whether input was deliberate FTS5 syntax, so any query containing an operator character anywhere (*, (, ), :, AND, OR) was passed to SQLite unescaped. A comma or apostrophe in an otherwise plain search (e.g. "hello, world", "it's") reached FTS5's query parser unescaped and failed with a syntax error, surfaced to callers as a 500 (#1577). Replaces the whole-query heuristic with per-field classification: each whitespace-separated field is judged on its own (quoted phrase, real column filter, boolean operator between real operands, or literal text) instead of one field's syntax vouching for the whole query. Literal text is split into the same word units the table's tokenizer would produce and AND-ed together as quoted-prefix terms, sidestepping a SQLite unicode61 quirk where phrase-adjacency doesn't survive a mid-word apostrophe. Also fixes, found via review of the above: bare colon crashing on pasted URLs/paths/times, dangling/doubled AND-OR-NOT, bare standalone */(/), punctuation-only queries crashing on MATCH '', and column filters with punctuation values now stay column-scoped instead of crashing or silently searching every column. Fixes #1577
perber
force-pushed
the
fix/1577-search-special-chars
branch
from
September 21, 2026 15:48
8be379e to
eebae1e
Compare
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.
No description provided.