SQLite

Check-in [3e25ba6e42]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Disable the pagerAcquireMapPage() routine if memory-mapped I/O is disabled. This fixes a harmless compiler warning on OpenBSD.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3e25ba6e42fba239795a465b8510386a361ee5be
User & Date: drh 2016-12-30 12:06:22.488
Context
2016-12-30
12:10
Fix a harmless compiler warning in fuzzcheck.c (check-in: 2842bc6053 user: drh tags: trunk)
12:06
Disable the pagerAcquireMapPage() routine if memory-mapped I/O is disabled. This fixes a harmless compiler warning on OpenBSD. (check-in: 3e25ba6e42 user: drh tags: trunk)
00:09
Encode a 64-bit integer literal in date.c as a constant expression so that it works on older compilers. Also fix a harmless compiler warning in vdbe.c. (check-in: f57952bac6 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
3960
3961
3962
3963
3964
3965
3966

3967
3968
3969
3970
3971
3972
3973
  }
  if( rc==SQLITE_OK ){
    rc = sqlite3OsFileSize(pPager->jfd, &pPager->journalHdr);
  }
  return rc;
}


/*
** Obtain a reference to a memory mapped page object for page number pgno. 
** The new object will use the pointer pData, obtained from xFetch().
** If successful, set *ppPage to point to the new page reference
** and return SQLITE_OK. Otherwise, return an SQLite error code and set
** *ppPage to zero.
**







>







3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
  }
  if( rc==SQLITE_OK ){
    rc = sqlite3OsFileSize(pPager->jfd, &pPager->journalHdr);
  }
  return rc;
}

#if SQLITE_MAX_MMAP_SIZE>0
/*
** Obtain a reference to a memory mapped page object for page number pgno. 
** The new object will use the pointer pData, obtained from xFetch().
** If successful, set *ppPage to point to the new page reference
** and return SQLITE_OK. Otherwise, return an SQLite error code and set
** *ppPage to zero.
**
4008
4009
4010
4011
4012
4013
4014

4015
4016
4017
4018
4019
4020
4021

  p->pgno = pgno;
  p->pData = pData;
  pPager->nMmapOut++;

  return SQLITE_OK;
}


/*
** Release a reference to page pPg. pPg must have been returned by an 
** earlier call to pagerAcquireMapPage().
*/
static void pagerReleaseMapPage(PgHdr *pPg){
  Pager *pPager = pPg->pPager;







>







4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023

  p->pgno = pgno;
  p->pData = pData;
  pPager->nMmapOut++;

  return SQLITE_OK;
}
#endif

/*
** Release a reference to page pPg. pPg must have been returned by an 
** earlier call to pagerAcquireMapPage().
*/
static void pagerReleaseMapPage(PgHdr *pPg){
  Pager *pPager = pPg->pPager;