1
0
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:
dan
2010-07-07 16:18:45 +00:00
parent 538fa0b716
commit 7fb574ecf7
3 changed files with 10 additions and 9 deletions

View File

@@ -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);
}