SQLite User Forum

SQLite 3.34.0 causes Tracker 3 test suite to fail (database corrupt)
Login

SQLite 3.34.0 causes Tracker 3 test suite to fail (database corrupt)

(1) By heftig on 2020-12-09 12:19:36 [source]

Previous bug report at Arch Linux FS#68903.

With SQLite 3.34.0, tracker-fd-test from the GNOME Tracker 3.0.1 or 3.0.2 test suite fails with:

Tracker-CRITICAL **: 02:39:41.823: SQLite error: database disk image is malformed (errno: Success)

Apparently sqlite3_step returns SQLITE_CORRUPT. When using SQLite 3.33.0, the test suite passes.

Enabling debug support by passing --buildtype debug to meson and running the tests with TRACKER_DEBUG=sqlite,sql-statements dbus-run-session meson test --print-errorlogs -t 3 shows the last statement executed:

Tracker-Message: 10:22:32.985: Executing update: 'INSERT INTO "main".fts5 (fts5, rowid , "nco:phoneNumber", "nfo:fontFamily", "nmm:artistName", "nfo:tableOfContents", "nfo:fileName", "nfo:genre", "nmm:genre", "nco:emailAddress", "nie:keyword", "nmm:category", "nco:nameAdditional", "nco:nameFamily", "nco:nameGiven", "nco:contactGroupName", "nco:fullname", "nco:nickname", "nco:country", "nco:county", "nco:district", "nco:extendedAddress", "nco:locality", "nco:pobox", "nco:postalcode", "nco:region", "nco:streetAddress", "nco:imID", "nco:imNickname", "nie:comment", "nie:description", "nie:plainTextContent", "nie:subject", "nie:title", "nao:description", "nao:prefLabel", "nco:department", "nco:role", "nco:title", "nco:note") SELECT 'delete', rowid , "nco:phoneNumber", "nfo:fontFamily", "nmm:artistName", "nfo:tableOfContents", "nfo:fileName", "nfo:genre", "nmm:genre", "nco:emailAddress", "nie:keyword", "nmm:category", "nco:nameAdditional", "nco:nameFamily", "nco:nameGiven", "nco:contactGroupName", "nco:fullname", "nco:nickname", "nco:country", "nco:county", "nco:district", "nco:extendedAddress", "nco:locality", "nco:pobox", "nco:postalcode", "nco:region", "nco:streetAddress", "nco:imID", "nco:imNickname", "nie:comment", "nie:description", "nie:plainTextContent", "nie:subject", "nie:title", "nao:description", "nao:prefLabel", "nco:department", "nco:role", "nco:title", "nco:note" FROM "main".fts_view WHERE rowid = 100002'

(2) By anonymous on 2020-12-09 16:40:06 in reply to 1 [link] [source]

git bisection shows:

86f477edaa17767b39c7bae5b67cac8580f7a8c1 is the first bad commit
commit 86f477edaa17767b39c7bae5b67cac8580f7a8c1
Author: dan <dan@noemail.net>
Date:   Fri Sep 11 15:01:49 2020 +0000

    Catch fts5 index corruption caused by issuing 'delete' commands with incorrect data earlier in some cases. Also fix a couple of test script problems.
    
    FossilOrigin-Name: b79f19edfd33c2a75f936c352668e14e81f35acf4f07edc27a21f941a7304b38

(3) By heftig on 2020-12-10 12:15:17 in reply to 1 [link] [source]

This is solved with a patch to Tracker.