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

Continuing refinements to the filesize-in-header enhancement.

FossilOrigin-Name: 79e22b95038c50b9b7f35e09262805ff6338b59b
This commit is contained in:
drh
2010-03-30 22:58:33 +00:00
parent bf59283ba2
commit b1299158c7
8 changed files with 52 additions and 62 deletions

View File

@@ -5616,19 +5616,7 @@ case OP_VUpdate: {
** Write the current number of pages in database P1 to memory cell P2.
*/
case OP_Pagecount: { /* out2-prerelease */
int p1;
int nPage;
Pager *pPager;
p1 = pOp->p1;
pPager = sqlite3BtreePager(db->aDb[p1].pBt);
rc = sqlite3PagerPagecount(pPager, &nPage);
/* OP_Pagecount is always called from within a read transaction. The
** page count has already been successfully read and cached. So the
** sqlite3PagerPagecount() call above cannot fail. */
if( ALWAYS(rc==SQLITE_OK) ){
pOut->u.i = nPage;
}
pOut->u.i = sqlite3BtreeLastPage(db->aDb[pOp->p1].pBt);
break;
}
#endif