1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix an assert that can fail if the schema is corrupt.

FossilOrigin-Name: ed57c48e4bb337810521bda2da79614313e4835a317ca4eadb52bd67e4eadf98
This commit is contained in:
drh
2019-11-17 11:47:50 +00:00
parent feb5dcf1a6
commit ac801803a5
3 changed files with 10 additions and 9 deletions

View File

@@ -4365,8 +4365,9 @@ static int btreeCursor(
/* The following assert statements verify that if this is a sharable
** b-tree database, the connection is holding the required table locks,
** and that no other connection has any open cursor that conflicts with
** this lock. */
assert( hasSharedCacheTableLock(p, iTable, pKeyInfo!=0, (wrFlag?2:1)) );
** this lock. The iTable<1 term disables the check for corrupt schemas. */
assert( hasSharedCacheTableLock(p, iTable, pKeyInfo!=0, (wrFlag?2:1))
|| iTable<1 );
assert( wrFlag==0 || !hasReadConflicts(p, iTable) );
/* Assert that the caller has opened the required transaction. */