On 3/15/19, Scott Perry <num...@apple.com> wrote: > The behaviour of ALTER TABLE changed in 3.25.0 and breaks compatibility with > many existing applications. Your statements (corrected for use of single > quotes, as Ryan mentioned) work for me when `PRAGMA legacy_alter_table=1;`.
All true. But even so, SQLite shouldn't leave the schema in a corrupt state - it should roll the schema back to something usable. I'm still investigating, but this looks like a real bug. I did observe that the bug only occurs if the sequence of ALTER TABLE statements that Tomasz provides occurs inside a transaction. If you do them all separately, no schema corruption occurs. Looking at the database after the error, I see that the SQLITE_MASTER table has an entry with a NAME of 'CAM_IN_FILE' and a TYPE of 'table' but with SQL of: 'CREATE TABLE "cam_in_file_22705_10035"(...)'. In other words, the sqlite_master.name does not agree with the name in the CREATE TABLE statement in sqlite_master.sql. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users