some select statements abort execution or return wrong values
A distilled example is:
CREATE TABLE A (id);
INSERT INTO A (id) VALUES ('A');
SELECT id FROM A WHERE id NOT IN ('A', 'B');
>>> returns 'A', which is not correct.
SELECT id FROM A WHERE id NOT IN ('A', 'A');
>>> (2) statement aborts at 15: [SELECT id FROM A WHERE id NOT IN ('A', 'A');]
But in our application the following queries also fail, depending on the given parameters:
SELECT keyID, valueID FROM Attributes WHERE entryID = 'JM87517';
11: database corruption at line 48036 of [118a3b3569];
11: statement aborts at 9: [SELECT keyID, valueID FROM Attributes WHERE entryID = :entryID] ;
SELECT DISTINCT l1_e_0.id, min(levenshtein('biol', l2_e_2.caption)) AS dst FROM InfixArray l2_inf_3 CROSS JOIN Entries l2_e_2 CROSS JOIN Entries l1_e_0 CROSS JOIN Terms l1_term_1 WHERE l1_e_0.typeID = 'thc' AND l1_term_1.termID = l2_e_2.id AND l1_e_0.id = l1_term_1.entryID AND l2_inf_3.infix = 'bar' AND l2_inf_3.typeID = 'tht' AND l2_e_2.id = l2_inf_3.entryID GROUP BY l1_e_0.id ORDER BY dst ASC;
11: database corruption at line 48036 of [118a3b3569];
11: statement aborts at 24: [SELECT DISTINCT l1_e_0.id, min(levenshtein(:l2_infcap, l2_e_2.caption)) AS dst FROM InfixArray l2_inf_3 CROSS JOIN Entries l2_e_2 CROSS JOIN Entries l1_e_0 CROSS JOIN Terms l1_term_1 W;
For some values they fail, for some they return the right values. SQLite without LMDB returns the correct results.