/ Ticket Change Details

Artifact ID: e331b118d2dd029a58f611295017641e314f7af092b229b4b4b4b2a245b845b6
Ticket: b41031ea2b5372378cb3d2d43cf9fe2a4a5c2510
ALTER TABLE returns an error on certain schemas
User & Date: drh 2018-09-16 20:33:15

  1. Change icomment to:

    Further information:

    The assert() seems harmless. But after removing it the ALTER TABLE statement returns an error.

    In version 3.25.0, the ALTER TABLE statement has been enhanced to run a test-parse of the whole schema after it alters the schema, to make sure that the edits it performed on the schema didn't break anything. There is a bug in this test-parse logic that gives a false positive when a virtual table is used inside the body of a trigger.

    So, the ALTER TABLE statement seemed to work correctly, but the extra sanity checking logic that runs at the end found a false-positive which causes the ALTER TABLE to rollback. This makes ALTER TABLE unusable for schemas that have triggers in which virtual tables are used in the body of the trigger. Because the failed ALTER TABLE is run inside a nested transaction which rollbacks after the failure, the failure does not cause corruption or otherwise harm the database file in any way. The ALTER TABLE simply fails to work.

  2. Change login to "drh"
  3. Change mimetype to "text/x-fossil-wiki"
  4. Change priority to "Immediate"
  5. Change resolution to "Open"
  6. Change subsystem to "Unknown"