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:
11
src/btree.c
11
src/btree.c
@@ -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;
|
||||
|
Reference in New Issue
Block a user