SQLite

Check-in [5ed2a445a1]
Login

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

Overview
Comment:Fixes so that it builds without warnings both with and without SQLITE_ENABLE_CONCURRENT.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | begin-concurrent
Files: files | file ages | folders
SHA1: 5ed2a445a164f0f0c2669c6681ea76618e639961
User & Date: drh 2015-09-01 17:48:54.487
Context
2015-09-01
18:01
Merge the latest trunk enhancements. (check-in: 3dea047465 user: drh tags: begin-concurrent)
17:48
Fixes so that it builds without warnings both with and without SQLITE_ENABLE_CONCURRENT. (check-in: 5ed2a445a1 user: drh tags: begin-concurrent)
2015-08-28
09:27
Merge latest trunk changes with this branch. (check-in: 57bc0194f4 user: dan tags: begin-concurrent)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
4005
4006
4007
4008
4009
4010
4011


4012
4013
4014
4015
4016
4017
4018
4019
      }
    }
    sqlite3PagerSetDbsize(pPager, nFin);
  }

  return rc;
}


#endif

/*
** This routine does the first phase of a two-phase commit.  This routine
** causes a rollback journal to be created (if it does not already exist)
** and populated with enough information so that if a power loss occurs
** the database can be restored to its original state by playing back
** the journal.  Then the contents of the journal are flushed out to







>
>
|







4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
      }
    }
    sqlite3PagerSetDbsize(pPager, nFin);
  }

  return rc;
}
#else
# define btreeFixUnlocked(X)  SQLITE_OK
#endif /* ENABLE_CONCURRENT */

/*
** This routine does the first phase of a two-phase commit.  This routine
** causes a rollback journal to be created (if it does not already exist)
** and populated with enough information so that if a power loss occurs
** the database can be restored to its original state by playing back
** the journal.  Then the contents of the journal are flushed out to
Changes to src/pager.c.
902
903
904
905
906
907
908

909

910
911
912
913
914
915
916

    case PAGER_WRITER_LOCKED:
      assert( p->eLock!=UNKNOWN_LOCK );
      assert( pPager->errCode==SQLITE_OK );
      if( !pagerUseWal(pPager) ){
        assert( p->eLock>=RESERVED_LOCK );
      }

      assert( pPager->dbSize==pPager->dbOrigSize || pPager->pAllRead );

      assert( pPager->dbOrigSize==pPager->dbFileSize );
      assert( pPager->dbOrigSize==pPager->dbHintSize );
      assert( pPager->setMaster==0 );
      break;

    case PAGER_WRITER_CACHEMOD:
      assert( p->eLock!=UNKNOWN_LOCK );







>

>







902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918

    case PAGER_WRITER_LOCKED:
      assert( p->eLock!=UNKNOWN_LOCK );
      assert( pPager->errCode==SQLITE_OK );
      if( !pagerUseWal(pPager) ){
        assert( p->eLock>=RESERVED_LOCK );
      }
#ifdef SQLITE_ENABLE_CONCURRENT
      assert( pPager->dbSize==pPager->dbOrigSize || pPager->pAllRead );
#endif
      assert( pPager->dbOrigSize==pPager->dbFileSize );
      assert( pPager->dbOrigSize==pPager->dbHintSize );
      assert( pPager->setMaster==0 );
      break;

    case PAGER_WRITER_CACHEMOD:
      assert( p->eLock!=UNKNOWN_LOCK );
Changes to src/pager.h.
196
197
198
199
200
201
202

203
204
205
206
207
208
209

#ifdef SQLITE_ENABLE_CONCURRENT
void sqlite3PagerEndConcurrent(Pager*);
int sqlite3PagerBeginConcurrent(Pager*);
void sqlite3PagerDropExclusiveLock(Pager*);
int sqlite3PagerUpgradeSnapshot(Pager *pPager, DbPage*);
void sqlite3PagerSetDbsize(Pager *pPager, Pgno);

#else
# define sqlite3PagerEndConcurrent(x)
#endif

int sqlite3PagerIswriteable(DbPage*);

#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL)







>







196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

#ifdef SQLITE_ENABLE_CONCURRENT
void sqlite3PagerEndConcurrent(Pager*);
int sqlite3PagerBeginConcurrent(Pager*);
void sqlite3PagerDropExclusiveLock(Pager*);
int sqlite3PagerUpgradeSnapshot(Pager *pPager, DbPage*);
void sqlite3PagerSetDbsize(Pager *pPager, Pgno);
int sqlite3PagerIsWal(Pager*);
#else
# define sqlite3PagerEndConcurrent(x)
#endif

int sqlite3PagerIswriteable(DbPage*);

#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL)
Changes to src/wal.c.
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
      }
    }
    assert( iRead==iRead2 );
  }
#endif

  *piRead = iRead;
  return SQLITE_OK;
}

/*
** Read the contents of frame iRead from the wal file into buffer pOut
** (which is nOut bytes in size). Return SQLITE_OK if successful, or an
** error code otherwise.
*/







|







2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
      }
    }
    assert( iRead==iRead2 );
  }
#endif

  *piRead = iRead;
  return rc;
}

/*
** Read the contents of frame iRead from the wal file into buffer pOut
** (which is nOut bytes in size). Return SQLITE_OK if successful, or an
** error code otherwise.
*/
Changes to src/wal.h.
122
123
124
125
126
127
128


129



130

131
132
133
134
135
136
137

/* Return true if the argument is non-NULL and the WAL module is using
** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
** WAL module is using shared-memory, return false. 
*/
int sqlite3WalHeapMemory(Wal *pWal);



int sqlite3WalLockForCommit(Wal *pWal, PgHdr *pPg, Bitvec *pRead);



int sqlite3WalUpgradeSnapshot(Wal *pWal);


#ifdef SQLITE_ENABLE_ZIPVFS
/* If the WAL file is not empty, return the number of bytes of content
** stored in each frame (i.e. the db page-size when the WAL was created).
*/
int sqlite3WalFramesize(Wal *pWal);
#endif







>
>

>
>
>

>







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143

/* Return true if the argument is non-NULL and the WAL module is using
** heap-memory for the wal-index. Otherwise, if the argument is NULL or the
** WAL module is using shared-memory, return false. 
*/
int sqlite3WalHeapMemory(Wal *pWal);

#ifdef SQLITE_ENABLE_CONCURRENT
/* Tell the wal layer that we want to commit a concurrent transaction */
int sqlite3WalLockForCommit(Wal *pWal, PgHdr *pPg, Bitvec *pRead);

/* Upgrade the state of the client to take into account changes written
** by other connections */
int sqlite3WalUpgradeSnapshot(Wal *pWal);
#endif

#ifdef SQLITE_ENABLE_ZIPVFS
/* If the WAL file is not empty, return the number of bytes of content
** stored in each frame (i.e. the db page-size when the WAL was created).
*/
int sqlite3WalFramesize(Wal *pWal);
#endif