(text/x-fossil-wiki)
When a CREATE TABLE AS statement is part of a larger transaction and it aborts
due to an error condition in the SELECT on the right-hand side, this can leave
the sqlite3_master table with a blank entry which subsequent database
connections will interpret as a corrupt database. The following SQL
illustrates the problem:
<blockquote><verbatim>
BEGIN;
CREATE TABLE t1 AS SELECT zeroblob(2e20);
COMMIT;
PRAGMA integrity_check;
</verbatim></blockquote>
This problem predates SQLite 3.5.1 (circa 2007).
|