SQLite

View Ticket
Login
2017-09-11
23:55 Fixed ticket [cfa2c908]: Assertion fault in STAT4 on a double-negation plus 5 other changes (artifact: 1f00b87e user: drh)
2017-06-13
04:31
Fix the processing of double-negatives in WHERE clause constraints with STAT4. Ticket [cfa2c908f2182] (check-in: 35b34bdf user: drh tags: trunk)
03:55 New ticket [cfa2c908] Assertion fault in STAT4 on a double-negation. (artifact: bea44233 user: drh)

Ticket Hash: cfa2c908f218254d7be64aa4b8fa55ba4df20853
Title: Assertion fault in STAT4 on a double-negation
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2017-09-11 23:55:47
Version Found In: 3.19.3
User Comments:
drh added on 2017-06-13 03:55:19:

When SQLite is compiled with SQLITE_ENABLE_STAT4, the following SQL causes an assertion fault or segfault:

CREATE TABLE t1(x);
CREATE INDEX t1x ON t1(x);
INSERT INTO t1 VALUES(1),(2),(3);
ANALYZE;
SELECT * FROM t1 WHERE x = -(-1);

This bug appears to have been in the STAT4 code since its STAT4 was first introduced in SQLite version 3.8.1 (2013-10-17).