aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <Dan Kennedy>2022-11-10 19:19:52 +0000
committerdan <Dan Kennedy>2022-11-10 19:19:52 +0000
commit873a84054c4ab9f8ef910d98970dd9b6882ff024 (patch)
tree37a76bd045056b97e6ce0df9195c426e998f0155 /src
parent2c4d62f013fb923118c13af6b7f038e3c3de0516 (diff)
downloadsqlite-873a84054c4ab9f8ef910d98970dd9b6882ff024.tar.gz
sqlite-873a84054c4ab9f8ef910d98970dd9b6882ff024.zip
Avoid returning SQLITE_SCHEMA if the first query run on a connection is "SELECT nosuchcolumn" or similar. Forum post <https://sqlite.org/forum/forumpost/c1798f77ef>.
FossilOrigin-Name: d31c019fd6849e4c3f8452e75c6cfefd613ade5355e896be368bd16fef28c627
Diffstat (limited to 'src')
-rw-r--r--src/prepare.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/prepare.c b/src/prepare.c
index 1e7a1222b..760738740 100644
--- a/src/prepare.c
+++ b/src/prepare.c
@@ -520,8 +520,8 @@ static void schemaIsValid(Parse *pParse){
sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie);
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
+ if( DbHasProperty(db, iDb, DB_SchemaLoaded) ) pParse->rc = SQLITE_SCHEMA;
sqlite3ResetOneSchema(db, iDb);
- pParse->rc = SQLITE_SCHEMA;
}
/* Close the transaction, if one was opened. */