fix(search): cap an expression at 256 atoms
The compiled SQL chains every atom into one expression, and SQLite rejects expressions deeper than 1000 levels. A query of about 1000 words parsed but then failed in SQL, outside the syntax-error handling, and crashed the app. The parser now rejects more than 256 atoms as a syntax error.
This commit is contained in:
1 parent
1d744ba504
commit
23f7806e2d
5 files changed
+79
-4
No files matched your search
@@ -226,6 +226,7 @@ These are invalid:
|
||||
|---|---|
|
||||
| Unbalanced parentheses | `(tag:bug`, `tag:bug)` |
|
||||
| Parentheses nested more than 64 levels deep | `((((…a…))))` with 65 `(` |
|
||||
| More than 256 search terms (words, phrases and qualifiers) | 257 words |
|
||||
| An operator with a missing side | `bug AND`, `OR bug` |
|
||||
| Consecutive operators | `a AND OR b` |
|
||||
| A qualifier without a value | `tag:` |
|
||||
|
||||
Reference in new issue
Block a user