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

Enhance sqlite3BtreeSetPageSize() so that it detects early if no changes

are needed and exists with SQLITE_OK.

FossilOrigin-Name: c978aed3b6f82b3d9d2e0ca0283c611351bca5e5496e86a9d5d0731ebcd27c84
This commit is contained in:
drh
2025-06-20 13:12:55 +00:00
parent 59de42763f
commit b68d63158a
3 changed files with 11 additions and 7 deletions

View File

@@ -3074,6 +3074,10 @@ int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, int iFix){
sqlite3BtreeEnter(p);
pBt->nReserveWanted = (u8)nReserve;
x = pBt->pageSize - pBt->usableSize;
if( x==nReserve && (pageSize==0 || pageSize==pBt->pageSize) ){
sqlite3BtreeLeave(p);
return SQLITE_OK;
}
if( nReserve<x ) nReserve = x;
if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
sqlite3BtreeLeave(p);