1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Merge latest begin-concurrent changes with this branch.

FossilOrigin-Name: 1625887c0240eb1cb37e41d79e789c4ff311352c5708e6a2d3ed1b223ff382e3
This commit is contained in:
dan
2018-12-29 20:47:45 +00:00
7 changed files with 47 additions and 16 deletions

View File

@@ -4032,7 +4032,12 @@ int sqlite3WalEndWriteTransaction(Wal *pWal){
** Otherwise, if the callback function does not return an error, this
** function returns SQLITE_OK.
*/
int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){
int sqlite3WalUndo(
Wal *pWal,
int (*xUndo)(void *, Pgno),
void *pUndoCtx,
int bConcurrent /* True if this is a CONCURRENT transaction */
){
int rc = SQLITE_OK;
if( pWal->writeLock ){
int iWal = walidxGetFile(&pWal->hdr);
@@ -4063,8 +4068,11 @@ int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){
** occurred in WalLockForCommit(), before any pages were written
** to the database file. In this case return early. */
#ifndef SQLITE_OMIT_CONCURRENT
if( bConcurrent ){
pWal->hdr.aCksum[0]++;
}
if( walidxGetFile(&pWal->hdr)!=iWal ){
assert( isWalMode2(pWal) );
assert( bConcurrent && isWalMode2(pWal) );
return SQLITE_OK;
}
#endif