From 530ea20001cfc9f0a217fc59e7ee521f3ade17e9 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Oct 2026 21:59:18 -0500 Subject: [PATCH] Fix full-text search missing matches in clips over ~2000 characters SQLite (3.44+, including the bundled 3.53.2) reads BLOB values larger than 4000 bytes from overflow pages through a column cache that tags them as UTF-8, even in a UTF-16 database. LIKE and REGEXP then read the UTF-16 bytes as UTF-8 and stop at the first zero byte, so full-text search only saw the first character of large CF_UNICODETEXT clips and effectively searched only the 500-character description. Passing the blob through substr() makes SQLite re-tag the function result with the database encoding, so the whole text is searched again. --- src/QPasteWnd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QPasteWnd.cpp b/src/QPasteWnd.cpp index 08fedfc6..beb28875 100644 --- a/src/QPasteWnd.cpp +++ b/src/QPasteWnd.cpp @@ -1589,7 +1589,7 @@ BOOL CQPasteWnd::FillList(CString csSQLSearch) csSQLSearch = csSQLSearch.Mid(3); } - fullTextFormat.SetVariable("Data.ooData"); + fullTextFormat.SetVariable("substr(Data.ooData, 1)"); fullTextFormat.Parse(csSQLSearch); fullTextSql = fullTextFormat.GetSQLString();