/ Check-in [36397f62]
Login

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

Overview
Comment:Fix the computation of the offset on the mmap() for the Nth shared memory region. Because of the way shared memory is accessed, the old computation, though wrong, still happened to always get the right answer. Nevertheless, it is good to do the computation correctly.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 36397f62f2e3a62b4d5730b29c197449c6850cac
User & Date: drh 2010-09-02 14:00:20
Context
2010-09-02
14:35
Add test case to verify the previous change is correct. check-in: 2a5eed35 user: dan tags: trunk
14:00
Fix the computation of the offset on the mmap() for the Nth shared memory region. Because of the way shared memory is accessed, the old computation, though wrong, still happened to always get the right answer. Nevertheless, it is good to do the computation correctly. check-in: 36397f62 user: drh tags: trunk
11:53
Add tests for the EXISTS operator to e_expr.test. check-in: 9f9a95cc user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/os_unix.c.

  3555   3555       if( !apNew ){
  3556   3556         rc = SQLITE_IOERR_NOMEM;
  3557   3557         goto shmpage_out;
  3558   3558       }
  3559   3559       pShmNode->apRegion = apNew;
  3560   3560       while(pShmNode->nRegion<=iRegion){
  3561   3561         void *pMem = mmap(0, szRegion, PROT_READ|PROT_WRITE, 
  3562         -          MAP_SHARED, pShmNode->h, iRegion*szRegion
         3562  +          MAP_SHARED, pShmNode->h, pShmNode->nRegion*szRegion
  3563   3563         );
  3564   3564         if( pMem==MAP_FAILED ){
  3565   3565           rc = SQLITE_IOERR;
  3566   3566           goto shmpage_out;
  3567   3567         }
  3568   3568         pShmNode->apRegion[pShmNode->nRegion] = pMem;
  3569   3569         pShmNode->nRegion++;