vomebook commited on
Commit
55c219e
·
verified ·
1 Parent(s): b0a8084

Fix large FTS5 wildcard verification on SQLite 3.37

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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: