SQLite

Ticket Change Details
Login
Overview

Artifact ID: 151ec2376572a55d7faa15df02e54c6928fcc0b53baa9a80e09f4a6cc1602e3d
Ticket: 79cad5e4b2e219dd197242e9e5f4ef950f554684
UPSERT results in a corrupt database
User & Date: drh 2018-07-11 12:11:13
Changes

  1. foundin changed to: "3.24.0"
  2. icomment:
    An UPSERT discovered by OSSFuzz results in a corrupt database file:
    
    <blockquote><verbatim>
    CREATE TABLE t1(
      a INT,
      b INT,
      c INT UNIQUE,
      PRIMARY KEY(a,b)
    ) WITHOUT ROWID;
    INSERT INTO t1(a,b) VALUES(json(3),4),(1,2) ON CONFLICT(a,b) DO NOTHING;
    PRAGMA integrity_check;
    </verbatim></blockquote>
    
    The corruption is a missing entry from the unique index and is easily
    fixed using REINDEX.  Nevertheless, this should not be happening.
    
  3. login: "drh"
  4. mimetype: "text/x-fossil-wiki"
  5. severity changed to: "Severe"
  6. status changed to: "Open"
  7. title changed to: "UPSERT results in a corrupt database"
  8. type changed to: "Code_Defect"