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

Increase test coverage following the introduction of the new

filesize-in-header logic.

FossilOrigin-Name: dbc2c3c0144d2c76aec04f80892302c532947dc8
This commit is contained in:
drh
2010-03-31 02:31:33 +00:00
parent b1299158c7
commit 97b59a56d2
4 changed files with 20 additions and 15 deletions

View File

@@ -2252,9 +2252,14 @@ static int lockBtree(BtShared *pBt){
** a valid database file.
*/
nPage = get4byte(28+(u8*)pPage1->aData);
if( nPage==0 && (rc = sqlite3PagerPagecount(pBt->pPager, &nPage))!=0 ){
goto page1_init_failed;
}else if( nPage>0 ){
if( nPage==0 ){
rc = sqlite3PagerPagecount(pBt->pPager, &nPage);
/* The sqlite3PagerSharedLock() call above has already determined
** the database file size, so this call to sqlite3PagerPagecount()
** cannot fail. */
if( NEVER(rc) ) goto page1_init_failed;
}
if( nPage>0 ){
int pageSize;
int usableSize;
u8 *page1 = pPage1->aData;