SQLite

View Ticket
Login
Ticket Hash: dc3f932f5a147771b0f370942cfe758fd85fcd4c
Title: Assertion fault doing a REPLACE with index on an expression.
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2018-01-02 18:11:20
Version Found In: 3.21.0
User Comments:
drh added on 2018-01-02 17:40:34:

The following SQL causes an assertion fault on the REPLACE statement:

CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE);
CREATE INDEX t1ab ON t1(a*b);
INSERT INTO t1(a,b) VALUES(1,2);
REPLACE INTO t1(a,b) VALUES(1,3);

This problem appears to go back to the introduction of indexes on expressions with SQLite release 3.9.0 on 2015-10-14. The problem was discovered by OSSFuzz.