/ Ticket Change Details
Login
Overview

Artifact ID: 0acc8b258a4e123cc90f019b95be4470bf21ab9ac55177e1a8369a264f5afad3
Ticket: 596d059af77f249314159d608e7449c899ea0764
Committing a transaction with a failed ALTER TABLE may subtly corrupt schema
User & Date: dan 2019-03-15 15:43:08
Changes

  1. Change icomment to:
      CREATE TABLE t1(a, b);
      CREATE TABLE t3(e, f);
      CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
        INSERT INTO t2 VALUES(new.a, new.b);
      END;
      BEGIN;
        ALTER TABLE t3 RENAME TO t4;
      COMMIT;
      SELECT * FROM sqlite_master WHERE type='table' AND name!='t1';
    

    The output of the above script is:

      table|t3|t3|3|CREATE TABLE "t4"(e, f) 
    

    The schema is now corrupt - as the table name in the SQL does not match the table names in the "name" and "tbl_name" columns.

  2. Change login to "dan"
  3. Change mimetype to "text/x-fossil-wiki"
  4. Change severity to "Critical"
  5. Change status to "Open"
  6. Change title to:

    Committing a transaction with a failed ALTER TABLE may subtly corrupt schema

  7. Change type to "Code_Defect"