SQLite Forum

Bug: Database schema corruption
Login
Hi,

It seems like running 'begin; create view if not exists IF as select *;' corrupts the database schema and produces lots of syntax errors (example attached). Is this a bug or intended behavior?

Thanks!

SQLite version 3.34.0 2020-10-20 14:40:53
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> /*works*/
sqlite> CREATE TABLE Persons (PersonID int, LastName varchar(255));
sqlite> select a from bbb;
Error: no such table: bbb
sqlite> /*start faulty sql*/
sqlite> begin;
sqlite> create view if not exists IF as select *;        
Error: malformed database schema (IF) - near "as": syntax error
sqlite> /*persistent errors now*/        
sqlite> CREATE TABLE anotherTable (id int, name varchar(255));
Error: malformed database schema (IF) - near "as": syntax error
sqlite> select a from bbb;
Error: malformed database schema (IF) - near "as": syntax error