|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Nov 2026
Device: Kobo colour libra
|
Summary
When upgrading to Kobo OS 6.0.279225, the KoboReader.sqlite schema migration from DbVersion 219 to 220 silently fails and rolls back if any sideloaded book entry in the content table contains URL-encoded sequences such as %20, %28, %29, %2C (or any literal %2–%9) in its legacy !-delimited ContentID path or internal spine path. Because the migration transaction rolls back and retries on every boot:
Root Cause During the 219 -> 220 migration, rows are inserted into ShortcoverSpineData by formatting an SQL INSERT template with 9 placeholders (%1 through %9): Code:
INSERT OR IGNORE INTO "ShortcoverSpineData"
("ShortcoverId", "Format", "BookPath", "SpinePath", "Fragment", "TocDepth", "AdobeChapterIndex", "PdfPageNumber", "PartId")
VALUES ('%1', %2, %3, %4, %5, %6, %7, %8, %9);
repare + bindValue), the statement is built using sequential chained QString::arg() calls (one .arg(...) call per column, from %1 to %9).In Qt, single-argument QString::arg() replaces all occurrences of the lowest-numbered %N placeholder currently present in the string. Once %2 (Format) and %3 (BookPath) have been substituted, any %2–%9 sequence inside a substituted BookPath (%3), SpinePath (%4), or Fragment (%5) re-introduces a lower-numbered placeholder inside the SQL string literal. Subsequent .arg() calls then overwrite characters inside the path string instead of %4–%9. Minimal Reproduction
Step-by-step SQL corruption trace Using the example SpinePath 'Text/Example_%28illustrated%29_split_001.htm':
(Note: Any percent-encoded sequence starting with %2–%9 triggers this when inserted before higher-numbered placeholders — e.g. %20 space, %26 &, %28/%29 (), %2C ,, %3A :, or UTF-8 %8x–%9x.) Suggested Fix Replace the chained QString::arg() string formatting in the 219 -> 220 migration with a parameterized QSqlQuery (prepare(...) + bindValue(...)) reused across rows within the migration transaction: Code:
INSERT OR IGNORE INTO "ShortcoverSpineData"
("ShortcoverId", "Format", "BookPath", "SpinePath", "Fragment", "TocDepth", "AdobeChapterIndex", "PdfPageNumber", "PartId")
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Firmware 6.0.279225 | geek1011 | Kobo Reader | 50 | Today 03:01 PM |
| Hello From Arg! | V0iD | Introduce Yourself | 1 | 12-22-2025 03:54 AM |
| Header fails to recognize chapter progress - bug? | Skydog | Kobo Reader | 2 | 04-06-2022 11:16 PM |
| Bug in renaming file in BookBrowser should show full paths mode. | The_book | Sigil | 8 | 03-25-2020 03:20 PM |