Hi all,

I'm running into a bug where the FTS offsets() function is returning a 
null string, causing SQLITE_CORRUPT to be reported for SELECT query 
results in both SQLite 3.11 and 3.12.2.

This is similar to a previously reported issue with SQLite from a while 
back - <http://www.sqlite.org/src/info/9861b74ab9> 
<http://sqlite.1065341.n5.nabble.com/regression-in-FTS3-offsets-function-in-3-6-23-td15216.html>,
 
however the minimal example from that report does not trigger any error 
in 3.11/3.12.2.

Unfortunately, I haven't been able to produce a minimal example for 
this new instance of the bug. Taking problematic rows from the existing 
DB, inserting them into a new FTS4 table, then running the same query 
is not triggering it. I can however reproduce it with a freshly 
constructed copy of the application's database, so it may not be an 
actual corrupt database. I cannot post the database file to a public 
forum however, since it contains confidential information.

A minimal query on the database in question that produces the error is 
simply of the form:

 > SELECT offsets(FTS4Table) FROM FTS4Table WHERE FTS4Table MATCH 
'somestr';

I can say that it is the offsets() function that is causing it - 
removing/replacing it in the SELECT statement makes the error go away. 
The form of the MATCH string doesn't seem to matter, but only some 
strings will cause the error to appear. Also, a custom tokeniser is in 
use - unicodesn from here: 
<https://git.gnome.org/browse/geary/tree/src/sqlite3-unicodesn>

For context, the application's bug report is here: 
<https://bugzilla.gnome.org/show_bug.cgi?id=765515>

What can I do to help resolve this bug?

//Mike

-- 
? Michael Gratton, Percept Wrangler.
? <http://mjog.vee.net/>


Reply via email to