View Single Post
Old 01-17-2018, 06:33 PM   #1857
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,147
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Removing document KUAL from 5.9.x

The good news:
I finished a script that can be used as a RUNME.sh type of script to clean-up the delete of the KUAL document.

The bad news:
It leaves the entries in /var/local/cc.db due to a screw-up on Amazon/Lab126's part:
Spoiler:

Code:
[root@kindle local]# sqlite3  ${cc_at}cc.db "DELETE FROM Entries WHERE p_location LIKE '%KUAL-KDK-2.0.azw2';"
Error: no such collation sequence: icu

[root@kindle local]# sqlite3  ${cc_at}cc.db "SELECT p_location FROM Entries WHERE p_location LIKE '%KUAL-KDK-2.0.azw2';"
/mnt/us/documents/KUAL-KDK-2.0.azw2
As the author of the database table at Lab126 said (in the schema comments):
Code:
CREATE TABLE Entries
(
    p_uuid PRIMARY KEY NOT NULL,       -- ID of entry (UUID)
- - - - -
    p_titles_0_collation COLLATE icu,  -- Used only for filtering and sorting
- - - - -
    p_credits_0_name_collation COLLATE icu,
                                       -- Collation string for first credit (string)
- - - - -
The "Used only for filtering and sorting" comment is wrong, and the author would realize it if s/he took a few minutes to think about it - - -
You can't insert or remove a record without ensuring that the collation order is also updated.
Duh...

It will be one more day while I work out a work-around for this brain fart in 5.9.2 firmware.
(Someone already suggested to just mark it as "not visible" - that or something like it might be the answer.)

This is most likely also the cause of why the 'delete document' action does not work on the KUAL document, but I am not about to waste my time troubleshooting custom call-backs in their Java code.
(that collate: icu is an Android "feature")

And then again...
Maybe it is user error:
http://www.sqlite.org/src/doc/trunk/ext/icu/README.txt

And then again...
So try following the sqlite.org directions, and:
Code:
[root@kindle local]# sqlite3 cc.db
SQLite version 3.7.14.1 2012-10-04 19:37:12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"

sqlite> .dump Locale
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE Locale ( locale );
INSERT INTO "Locale" VALUES('en_US.utf8');
COMMIT;

sqlite> SELECT * FROM Locale;
en_US.utf8

sqlite> SELECT icu_load_collation('en_US.utf8', 'icu');
Error: no such function: icu_load_collation
sqlite>
????
Well, the answer to that one happens to be on the first line shown above.
SQLite version 3.7.14.1 2012-10-04 19:37:12
The ability to load a custom collation was first added to sqlite3, version 3.7.16

The current version is 3.21
My Ubuntu LTS has 3.20 installed.
So the most likely situation is the (?contractor?) person at Lab126 is doing all of s/he's work on a PC (with a current or nearly current version) and never checking their work on the Kindle.

Update:
The above was from 5.9.2 -
A similar problem exists on 5.3.7.3 (the oldest ts firmware version we support here).
I.E: The interactive sqlite3 can not delete records from cc.db for the same reason (the extension library might be able to but not the interactive).

Last edited by knc1; 01-18-2018 at 03:38 PM.
knc1 is offline   Reply With Quote