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/resolve.c b/src/resolve.c
index 4e94827..74d6aae 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -357,6 +357,7 @@
     }else{
       sqlite3ErrorMsg(pParse, "%s: %s", zErr, zCol);
     }
+    pParse->checkSchema = 1;
     pTopNC->nErr++;
   }