SQLite

Ticket Change Details
Login
Overview

Artifact ID: 7f88fd969c22521cbf0a0d61eec19eddd3863d12
Ticket: 1b266395d6bc1041dbd907194539b2b81b7af1e2
INSERT OR REPLACE with a foreign key constraint leads to assertion fault
User & Date: drh 2015-09-30 12:10:31
Changes

  1. foundin changed to: "3.8.11.1"
  2. icomment:
    The following script causes an assertion fault:
    
    <blockquote><pre>
    PRAGMA foreign_keys=1;
    CREATE TABLE Foo (Id INTEGER PRIMARY KEY, ParentId INTEGER REFERENCES Foo(Id) ON DELETE CASCADE, C1);
    INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (1, null, 'A');
    INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (2, 1, 'A-2-1');
    INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (3, 2, 'A-3-2');
    INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (4, 3, 'A-4-3');
    INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (2, 3, 'A-2-3');
    </pre></blockquote>
    
    This problem appears to have been introduced with version 3.8.4, specifically
    at check-in [56bc5ce8958c8e625].
    
  3. login: "drh"
  4. mimetype: "text/x-fossil-wiki"
  5. severity changed to: "Severe"
  6. status changed to: "Open"
  7. title changed to:
    INSERT OR REPLACE with a foreign key constraint leads to assertion fault
    
  8. type changed to: "Code_Defect"