/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/os_unix.c.

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







|







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