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

Make sure the change-counter and SQLite-version fields of the header are

set correctly even when doing a VACUUM with locking_mode=EXCLUSIVE.
Ticket [5d863f876ee9561b].

FossilOrigin-Name: 04fa1e16905183b948ee6456675799a873d5f97d
This commit is contained in:
drh
2011-01-16 00:56:19 +00:00
parent 0bf1f496b8
commit d40d7ec78b
4 changed files with 15 additions and 14 deletions

View File

@@ -4005,6 +4005,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
char *pData; /* Data to write */
assert( (pList->flags&PGHDR_NEED_SYNC)==0 );
if( pList->pgno==1 ) pager_write_changecounter(pList);
/* Encode the database */
CODEC2(pPager, pList->pData, pgno, 6, return SQLITE_NOMEM, pData);
@@ -5584,7 +5585,7 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){
** direct mode, page 1 is always held in cache and hence the PagerGet()
** above is always successful - hence the ALWAYS on rc==SQLITE_OK.
*/
if( !DIRECT_MODE && ALWAYS(rc==SQLITE_OK) ){
if( !DIRECT_MODE && rc==SQLITE_OK ){
rc = sqlite3PagerWrite(pPgHdr);
}