SQLite

View Ticket
Login
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: (text/x-fossil-wiki)
When SQLite is compiled with SQLITE_ENABLE_STAT4, the following SQL causes
an assertion fault or segfault:

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

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).