diff options
author | dan <dan@noemail.net> | 2010-06-28 10:15:19 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-06-28 10:15:19 +0000 |
commit | 1db95106ee48da9743f2d64bf1fdf7ba6d1442ed (patch) | |
tree | 7b19ee3eceab2e088cd7d02792dad180c8965db1 /src | |
parent | 7750ab48f55204c274ebf7ca5422b5397b2ef3de (diff) | |
download | sqlite-1db95106ee48da9743f2d64bf1fdf7ba6d1442ed.tar.gz sqlite-1db95106ee48da9743f2d64bf1fdf7ba6d1442ed.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 1 | ||||
-rw-r--r-- | src/insert.c | 2 | ||||
-rw-r--r-- | src/resolve.c | 1 | ||||
-rw-r--r-- | src/select.c | 1 | ||||
-rw-r--r-- | src/trigger.c | 1 | ||||
-rw-r--r-- | src/update.c | 1 |
6 files changed, 6 insertions, 1 deletions
diff --git a/src/build.c b/src/build.c index 4c00e398e..ce3e61484 100644 --- a/src/build.c +++ b/src/build.c @@ -2614,6 +2614,7 @@ Index *sqlite3CreateIndex( if( j>=pTab->nCol ){ sqlite3ErrorMsg(pParse, "table %s has no column named %s", pTab->zName, zColName); + pParse->checkSchema = 1; goto exit_create_index; } pIndex->aiColumn[i] = j; diff --git a/src/insert.c b/src/insert.c index 05964f849..f6ad5ab9e 100644 --- a/src/insert.c +++ b/src/insert.c @@ -727,7 +727,7 @@ void sqlite3Insert( }else{ sqlite3ErrorMsg(pParse, "table %S has no column named %s", pTabList, 0, pColumn->a[i].zName); - pParse->nErr++; + pParse->checkSchema = 1; goto insert_cleanup; } } diff --git a/src/resolve.c b/src/resolve.c index 4e94827e9..74d6aaef9 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -357,6 +357,7 @@ static int lookupName( }else{ sqlite3ErrorMsg(pParse, "%s: %s", zErr, zCol); } + pParse->checkSchema = 1; pTopNC->nErr++; } diff --git a/src/select.c b/src/select.c index 9a016039a..b03e50638 100644 --- a/src/select.c +++ b/src/select.c @@ -3020,6 +3020,7 @@ int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){ ); if( !pIdx ){ sqlite3ErrorMsg(pParse, "no such index: %s", zIndex, 0); + pParse->checkSchema = 1; return SQLITE_ERROR; } pFrom->pIndex = pIdx; diff --git a/src/trigger.c b/src/trigger.c index 66464bdae..27fc708d7 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -496,6 +496,7 @@ void sqlite3DropTrigger(Parse *pParse, SrcList *pName, int noErr){ if( !noErr ){ sqlite3ErrorMsg(pParse, "no such trigger: %S", pName, 0); } + pParse->checkSchema = 1; goto drop_trigger_cleanup; } sqlite3DropTriggerPtr(pParse, pTrigger); diff --git a/src/update.c b/src/update.c index 3c82c2704..fe8344ca2 100644 --- a/src/update.c +++ b/src/update.c @@ -212,6 +212,7 @@ void sqlite3Update( pRowidExpr = pChanges->a[i].pExpr; }else{ sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); + pParse->checkSchema = 1; goto update_cleanup; } } |