Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove some assert() statements that can fail with corrupt databases. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7654ae71bd26ae5d713935624d2b6cb8 |
User & Date: | dan 2012-01-12 14:25:55.908 |
Context
2012-01-12
| ||
15:05 | Fix typos in a testcase() macro introduced by the previous commit. (check-in: 0467742fd6 user: dan tags: trunk) | |
14:25 | Remove some assert() statements that can fail with corrupt databases. (check-in: 7654ae71bd user: dan tags: trunk) | |
2012-01-11
| ||
16:16 | Remove code made unreachable by the enhancement of the previous check-in. (check-in: 9e31a275ef user: drh tags: trunk) | |
Changes
Changes to src/btree.c.
︙ | |||
4190 4191 4192 4193 4194 4195 4196 | 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 | - + | pCur->validNKey = 0; if( pNewPage->nCell<1 || pNewPage->intKey!=pCur->apPage[i]->intKey ){ return SQLITE_CORRUPT_BKPT; } return SQLITE_OK; } |
︙ | |||
4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 | 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 | + + + + + + + + + + | ** the largest cell index. */ static void moveToParent(BtCursor *pCur){ assert( cursorHoldsMutex(pCur) ); assert( pCur->eState==CURSOR_VALID ); assert( pCur->iPage>0 ); assert( pCur->apPage[pCur->iPage] ); /* UPDATE: It is actually possible for the condition tested by the assert ** below to be untrue if the database file is corrupt. This can occur if ** one cursor has modified page pParent while a reference to it is held ** by a second cursor. Which can only happen if a single page is linked ** into more than one b-tree structure in a corrupt database. */ #if 0 assertParentIndex( pCur->apPage[pCur->iPage-1], pCur->aiIdx[pCur->iPage-1], pCur->apPage[pCur->iPage]->pgno ); #endif testcase( iIdx>pParent->nCell ); releasePage(pCur->apPage[pCur->iPage]); pCur->iPage--; pCur->info.nSize = 0; pCur->validNKey = 0; } /* |
︙ | |||
4697 4698 4699 4700 4701 4702 4703 | 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 | + + + + + + - + | return SQLITE_OK; } pCur->skipNext = 0; pPage = pCur->apPage[pCur->iPage]; idx = ++pCur->aiIdx[pCur->iPage]; assert( pPage->isInit ); /* If the database file is corrupt, it is possible for the value of idx ** to be invalid here. This can only occur if a second cursor modifies ** the page while cursor pCur is holding a reference to it. Which can ** only happen if the database is corrupt in such a way as to link the ** page into more than one b-tree structure. */ |
︙ |
Added test/corruptF.test.