1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix an assert() in the OP_ParseSchema opcode that might fail on a corrupt

database file when running with PRAGMA writable_schema=ON.
dbsqlfuzz e7d743ca65f2767e415095f0c5a49166a0f55eea.

FossilOrigin-Name: 10801f65af495a999ef61741322ea82dc20bd92ea8e55e4016c409096f38b0d1
This commit is contained in:
drh
2021-06-07 11:50:23 +00:00
parent 9a4127a8c1
commit fe972341a5
3 changed files with 10 additions and 8 deletions

View File

@@ -6361,7 +6361,9 @@ case OP_ParseSchema: {
iDb = pOp->p1;
assert( iDb>=0 && iDb<db->nDb );
assert( DbHasProperty(db, iDb, DB_SchemaLoaded) || db->mallocFailed );
assert( DbHasProperty(db, iDb, DB_SchemaLoaded)
|| db->mallocFailed
|| (CORRUPT_DB && (db->flags & SQLITE_NoSchemaError)!=0) );
#ifndef SQLITE_OMIT_ALTERTABLE
if( pOp->p4.z==0 ){