aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-11-16 19:53:39 +0000
committerdrh <>2022-11-16 19:53:39 +0000
commita07df967f583692e0dde6f348bb1d28f6c264d25 (patch)
tree29d96c307fdc705ffba241c089e9b8bde778cb65 /src
parent2f2c5e2061cfebfad6b9aca4950d960caec073d8 (diff)
parent873a84054c4ab9f8ef910d98970dd9b6882ff024 (diff)
downloadsqlite-a07df967f583692e0dde6f348bb1d28f6c264d25.tar.gz
sqlite-a07df967f583692e0dde6f348bb1d28f6c264d25.zip
Avoid returning SQLITE_SCHEMA if the first query run on a connection
is "SELECT nosuchcolumn" or similar. [forum:/forumpost/c1798f77ef|Forum post c1798f77ef] FossilOrigin-Name: 3dc4f75d77417df1ef19be8e3191d246fb44ca7f7d1de7b161c5cb0f8aafeded
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. */