SQLite

View Ticket
Login
Ticket Hash: 369d57fb8e5ccdff06f197a37147a88f9de95cda
Title: DELETE with TRIGGER causes an assertion fault
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-08-21 15:57:30
Version Found In: 3.8.6
User Comments:
drh added on 2014-08-21 12:32:30:

The following SQL causes an assertion fault while running sqlite3_prepare() on the DELETE statement:

CREATE TABLE t1(x);
CREATE TABLE t2(y);
CREATE VIRTUAL TABLE t3 USING rtree(a,b,c);
CREATE TRIGGER t2del AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN 
  DELETE FROM t3 WHERE a=old.y; 
END;
DELETE FROM t2 WHERE y=1;

The problem appears to have been introduced by the addition of support for WITHOUT ROWID tables in SQLite version 3.8.2, specifically on check-in [c80e229dd9c1230a] on 2013-11-07.