SQLite

Ticket Change Details
Login
Overview

Artifact ID: 2db52790f128645fcedc8010cfe726f15da57c08
Ticket: f68bf68513a1c15ff405c54e39e637a9f8156f7b
ALTER TABLE corrupts DESC indexes
User & Date: drh 2016-07-14 18:46:40
Changes

  1. foundin changed to: "3.13.0"
  2. icomment:
    The change to ALTER TABLE in [e1d8ec85546c] can cause indexes to go corrupt.
    Sample code:
    
    <blockquote><verbatim>
    PRAGMA legacy_file_format=ON;
    CREATE TABLE t1(a,b,c);
    CREATE INDEX t1a ON t1(a DESC);
    INSERT INTO t1 VALUES(1,2,3);
    INSERT INTO t1 VALUES(2,3,4);
    ALTER TABLE t1 ADD COLUMN d;
    PRAGMA integrity_check;
    </verbatim></blockquote>
    
    If the schema version is initially less than 4, then the DESC keyword on 
    indexes is ignored.  If ALTER TABLE then changes the schema version to 4 from
    a smaller value, then preexisting DESC indexes will be in the wrong order.
    
    Corruption caused by this bug can be fixed by running the REINDEX command.
    
  3. login: "drh"
  4. mimetype: "text/x-fossil-wiki"
  5. severity changed to: "Severe"
  6. status changed to: "Open"
  7. title changed to: "ALTER TABLE corrupts DESC indexes"
  8. type changed to: "Code_Defect"