Index: src/attach.c ================================================================== --- src/attach.c +++ src/attach.c @@ -330,11 +330,10 @@ if( SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) || SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) || SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey)) ){ - pParse->nErr++; goto attach_end; } #ifndef SQLITE_OMIT_AUTHORIZATION if( pAuthArg ){ Index: src/build.c ================================================================== --- src/build.c +++ src/build.c @@ -761,18 +761,16 @@ sqlite3 *db = pParse->db; if( ALWAYS(pName2!=0) && pName2->n>0 ){ if( db->init.busy ) { sqlite3ErrorMsg(pParse, "corrupt database"); - pParse->nErr++; return -1; } *pUnqual = pName2; iDb = sqlite3FindDb(db, pName1); if( iDb<0 ){ sqlite3ErrorMsg(pParse, "unknown database %T", pName1); - pParse->nErr++; return -1; } }else{ assert( db->init.iDb==0 || db->init.busy ); iDb = db->init.iDb; Index: src/trigger.c ================================================================== --- src/trigger.c +++ src/trigger.c @@ -191,11 +191,10 @@ } /* Do not create a trigger on a system table */ if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){ sqlite3ErrorMsg(pParse, "cannot create trigger on system table"); - pParse->nErr++; goto trigger_cleanup; } /* INSTEAD of triggers are only for views and views only support INSTEAD ** of triggers. Index: test/table.test ================================================================== --- test/table.test +++ test/table.test @@ -269,10 +269,29 @@ DROP TABLE IF EXISTS sqlite_stat3; DROP TABLE IF EXISTS sqlite_stat4; SELECT name FROM sqlite_master WHERE name GLOB 'sqlite_stat*'; } } {} + +do_test table-5.2.2 { + db close + forcedelete test.db + sqlite3 db test.db + db eval { + CREATE TABLE t0(a,b); + CREATE INDEX t ON t0(a); + PRAGMA writable_schema=ON; + UPDATE sqlite_master SET sql='CREATE TABLE a.b(a UNIQUE'; + BEGIN; + CREATE TABLE t1(x); + ROLLBACK; + DROP TABLE IF EXISTS t99; + } +} {} +db close +forcedelete test.db +sqlite3 db test.db # Make sure an EXPLAIN does not really create a new table # do_test table-5.3 { ifcapable {explain} {