1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Experimental changes toward making snapshots serializable.

FossilOrigin-Name: b6a81fa1fc1fb78a65894129851a4ec3986640de
This commit is contained in:
drh
2016-11-15 17:37:56 +00:00
parent d6ef5afe3f
commit ba6eb8769f
4 changed files with 19 additions and 9 deletions

View File

@@ -3393,9 +3393,14 @@ int sqlite3WalHeapMemory(Wal *pWal){
int sqlite3WalSnapshotGet(Wal *pWal, sqlite3_snapshot **ppSnapshot){
int rc = SQLITE_OK;
WalIndexHdr *pRet;
static const u32 aZero[4] = { 0, 0, 0, 0 };
assert( pWal->readLock>=0 && pWal->writeLock==0 );
if( memcmp(&pWal->hdr.aFrameCksum[0],aZero,16)==0 ){
*ppSnapshot = 0;
return SQLITE_ERROR;
}
pRet = (WalIndexHdr*)sqlite3_malloc(sizeof(WalIndexHdr));
if( pRet==0 ){
rc = SQLITE_NOMEM_BKPT;