Currently, if SQLite cannot find a table or index referred to by a query, it reloads the database schema from disk to see if the table or index has been added since the schema was cached in memory. Extend this behaviour to columns (which may have been added using ALTER TABLE) and fix some obscure cases related to tables and indexes (INDEXED BY, DROP TABLE etc.).

FossilOrigin-Name: 4932f22848b3d15a2b6dc5fa2cd69ce19182e2a4
diff --git a/src/insert.c b/src/insert.c
index 05964f8..f6ad5ab 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -727,7 +727,7 @@
         }else{
           sqlite3ErrorMsg(pParse, "table %S has no column named %s",
               pTabList, 0, pColumn->a[i].zName);
-          pParse->nErr++;
+          pParse->checkSchema = 1;
           goto insert_cleanup;
         }
       }