Fix large FTS5 wildcard verification on SQLite 3.37
Browse files
app.py
CHANGED
|
@@ -501,7 +501,7 @@ class FulltextDatabases:
|
|
| 501 |
if len(candidates) >= WILDCARD_FTS_SCAN_MIN_CANDIDATES:
|
| 502 |
try:
|
| 503 |
rows = connection.execute(
|
| 504 |
-
"SELECT rowid FROM content_fts WHERE content GLOB ?", (glob_pattern,)
|
| 505 |
).fetchall()
|
| 506 |
return {int(row[0]) for row in rows if int(row[0]) in candidates}
|
| 507 |
except sqlite3.OperationalError:
|
|
|
|
| 501 |
if len(candidates) >= WILDCARD_FTS_SCAN_MIN_CANDIDATES:
|
| 502 |
try:
|
| 503 |
rows = connection.execute(
|
| 504 |
+
"SELECT rowid FROM content_fts WHERE (content GLOB ?) = 1", (glob_pattern,)
|
| 505 |
).fetchall()
|
| 506 |
return {int(row[0]) for row in rows if int(row[0]) in candidates}
|
| 507 |
except sqlite3.OperationalError:
|