mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Do not make the SQLITE_FCNTL_SIZE_HINT call if an error has already occurred during transaction commit.
FossilOrigin-Name: e92de834a39be07da5f0848d7ec5f1f6dff902a5
This commit is contained in:
@@ -3363,7 +3363,8 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
|
||||
/* Before the first write, give the VFS a hint of what the final
|
||||
** file size will be.
|
||||
*/
|
||||
if( pPager->dbSize > (pPager->dbOrigSize+1) && isOpen(pPager->fd) ){
|
||||
assert( rc!=SQLITE_OK || isOpen(pPager->fd) );
|
||||
if( rc==SQLITE_OK && pPager->dbSize>(pPager->dbOrigSize+1) ){
|
||||
sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
|
||||
sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
|
||||
}
|
||||
|
Reference in New Issue
Block a user