-C Update\sthis\sbranch\swith\slatest\strunk\schanges.
-D 2017-08-14T06:55:22.004
+C Remove\scode\sfor\sPLL\ssupport\sin\swal\smode\sfrom\sthis\sbranch.
+D 2017-08-14T07:16:18.805
F Makefile.in d9873c9925917cca9990ee24be17eb9613a668012c85a343aef7e5536ae266e8
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 02b469e9dcd5b7ee63fc1fb05babc174260ee4cfa4e0ef2e48c3c6801567a016
F src/os_unix.c 24e4b7f6f89b742357068959255c4530014254579c09c1b56beff1014eb0c0c1
F src/os_win.c 964165b66cde03abc72fe948198b01be608436894732eadb94c8720d2467f223
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
-F src/pager.c f2d2af4fd2e8c581ac0a07d5564da9321d555ee12d1371e174e271ed58a36199
+F src/pager.c 0cfac2557de08ac12ec8d2edd3c4cb69f96ad49b923f1390619c310aa684366e
F src/pager.h 316dac0671fd7555af9e73d4357febd5f2d3ce6a185ffd8d77b7fc0423ac8b1a
F src/parse.y 58a2de13e855aece3d7709440e6e86849f4cde97f5227c6a25e6bba2fc5e2976
F src/pcache.c 62835bed959e2914edd26afadfecce29ece0e870
F src/vdbetrace.c 41963d5376f0349842b5fc4aaaaacd7d9cdc0834
F src/vtab.c f1d5c23132fb0247af3e86146404112283ddedb6c518de0d4edc91cfb36970ef
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
-F src/wal.c 1b208938ba3c33cc419f6240d914f68a147e9abb336c578d4c153dd1579d40f8
+F src/wal.c 40c543f0a2195d1b0dc88ef12142bea690009344
F src/wal.h 739d92494eb18b6d8f3e353e66c10eb8f94534bafd336ece9f3f60235317ea08
F src/walker.c a7ca64ce08a83a20d32186fbe06bca9234e348cfcf07959ee322fdc3e8a6173a
F src/where.c cbe8ddffbcec7ce86f7a800fe8fd10aee412c76c87e0dd3732a1682e68d74cd9
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 17bc7ded07fe2f1f47857bba646eb297e53f69fb1bafd68556d60700ce008750 7e0d3e9cb071873564b7916c022aba5cd9f3b8ebab9dba787ecd7113c5b7816a
-R 730c18be52f4de912cd8696c8ab9607f
+P bc2498d60fa22b587ad463ec697abe82d1c87abb7fd0d2cb60cc7316cfd7cec7
+R 97b8be53027d87f1df1370ba323e39a9
U dan
-Z ba592691f21813c3d6a71d486db6b259
+Z cc211de634879a22eac42d92c4a3bb35
#ifdef SQLITE_ENABLE_SNAPSHOT
WalIndexHdr *pSnapshot; /* Start transaction here if not NULL */
#endif
-#ifdef SQLITE_SERVER_EDITION
- Server *pServer;
-#endif
};
-#ifdef SQLITE_SERVER_EDITION
-# define walIsServer(p) ((p)->pServer!=0)
-#else
-# define walIsServer(p) 0
-#endif
-
/*
** Candidate values for Wal.exclusiveMode.
*/
}
}
-#ifdef SQLITE_SERVER_EDITION
-int sqlite3WalServer(Wal *pWal, Server *pServer){
- assert( pWal->pServer==0 );
- pWal->pServer = pServer;
- return SQLITE_OK;
-}
-#endif
-
/*
** Open a connection to the WAL file zWalName. The database file must
** already be opened on connection pDbFd. The buffer that zWalName points
** indicate that the log file contains zero valid frames. */
walRestartHdr(pWal, salt1);
rc = sqlite3OsTruncate(pWal->pWalFd, 0);
- }else if( walIsServer(pWal) ){
- assert( eMode==SQLITE_CHECKPOINT_RESTART );
- walRestartHdr(pWal, salt1);
}
walUnlockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
}
return 0;
}
-static int walIndexWriteLock(Wal *pWal){
- if( walIsServer(pWal) ){
- return sqlite3ServerLock(pWal->pServer, 0, 1, 0);
- }else{
- return walLockExclusive(pWal, WAL_WRITE_LOCK, 1);
- }
-}
-
/*
** Read the wal-index header from the wal-index and into pWal->hdr.
** If the wal-header appears to be corrupt, try to reconstruct the
assert( badHdr==0 || pWal->writeLock==0 );
if( badHdr ){
if( pWal->readOnly & WAL_SHM_RDONLY ){
- assert( walIsServer(pWal)==0 );
if( SQLITE_OK==(rc = walLockShared(pWal, WAL_WRITE_LOCK)) ){
walUnlockShared(pWal, WAL_WRITE_LOCK);
rc = SQLITE_READONLY_RECOVERY;
}
- }else if( SQLITE_OK==(rc = walIndexWriteLock(pWal)) ){
+ }else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){
pWal->writeLock = 1;
if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){
badHdr = walIndexTryHdr(pWal, pChanged);
}
}
pWal->writeLock = 0;
- if( walIsServer(pWal)==0 ){
- walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1);
- }
+ walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1);
}
}
}
}
- assert( rc==SQLITE_OK );
- if( walIsServer(pWal) ) return SQLITE_OK;
-
pInfo = walCkptInfo(pWal);
if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame
#ifdef SQLITE_ENABLE_SNAPSHOT
int iMinHash;
/* This routine is only be called from within a read transaction. */
- assert( walIsServer(pWal) || pWal->readLock>=0 || pWal->lockError );
-
- assert( walIsServer(pWal)==0 || pWal->writeLock==0
- || sqlite3ServerHasLock(pWal->pServer, 0, 1)
- );
- if( walIsServer(pWal) && pWal->writeLock==0 ){
- /* A server mode connection must read from the most recent snapshot. */
- iLast = walIndexHdr(pWal)->mxFrame;
- }
+ assert( pWal->readLock>=0 || pWal->lockError );
/* If the "last page" field of the wal-index header snapshot is 0, then
** no data will be read from the wal under any circumstances. Return early
** Return the size of the database in pages (or zero, if unknown).
*/
Pgno sqlite3WalDbsize(Wal *pWal){
- if( pWal && (walIsServer(pWal) || ALWAYS(pWal->readLock>=0)) ){
+ if( pWal && ALWAYS(pWal->readLock>=0) ){
return pWal->hdr.nPage;
}
return 0;
/* Cannot start a write transaction without first holding a read
** transaction. */
- assert( walIsServer(pWal) || pWal->readLock>=0 );
+ assert( pWal->readLock>=0 );
assert( pWal->writeLock==0 && pWal->iReCksum==0 );
if( pWal->readOnly ){
return SQLITE_READONLY;
}
- /* For a server connection, do nothing at this point. */
- if( walIsServer(pWal) ){
- return SQLITE_OK;
- }
-
/* Only one writer allowed at a time. Get the write lock. Return
** SQLITE_BUSY if unable.
*/
*/
int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){
int rc = SQLITE_OK;
- if( pWal->writeLock ){
+ if( ALWAYS(pWal->writeLock) ){
Pgno iMax = pWal->hdr.mxFrame;
Pgno iFrame;
** if an error occurs.
*/
static int walRestartLog(Wal *pWal){
- volatile WalCkptInfo *pInfo = walCkptInfo(pWal);
int rc = SQLITE_OK;
int cnt;
- if( pWal->readLock==0
- || (walIsServer(pWal) && pInfo->nBackfill==pWal->hdr.mxFrame)
- ){
+ if( pWal->readLock==0 ){
+ volatile WalCkptInfo *pInfo = walCkptInfo(pWal);
assert( pInfo->nBackfill==pWal->hdr.mxFrame );
if( pInfo->nBackfill>0 ){
u32 salt1;
return rc;
}
}
- if( walIsServer(pWal) ) return rc;
walUnlockShared(pWal, WAL_READ_LOCK(0));
pWal->readLock = -1;
cnt = 0;
WalIndexHdr *pLive; /* Pointer to shared header */
assert( pList );
- assert( pWal->writeLock || walIsServer(pWal) );
- if( pWal->writeLock==0 ){
- int bDummy = 0;
-#if 0
- rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1);
-#endif
- rc = sqlite3ServerLock(pWal->pServer, 0, 1, 1);
- if( rc==SQLITE_OK ){
- pWal->writeLock = 1;
- rc = walIndexTryHdr(pWal, &bDummy);
- }
- if( rc!=SQLITE_OK ){
- return rc;
- }
- assert( sqlite3ServerHasLock(pWal->pServer, 0, 1) );
- }
- assert( walIsServer(pWal)==0 || sqlite3ServerHasLock(pWal->pServer, 0, 1) );
+ assert( pWal->writeLock );
/* If this frame set completes a transaction, then nTruncate>0. If
** nTruncate==0 then this frame set does not complete the transaction. */
/* See if it is possible to write these frames into the start of the
** log file, instead of appending to it at pWal->hdr.mxFrame.
*/
- if( walIsServer(pWal)==0 && SQLITE_OK!=(rc = walRestartLog(pWal)) ){
+ if( SQLITE_OK!=(rc = walRestartLog(pWal)) ){
return rc;
}
** lock is successfully obtained.
*/
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){
- if( walIsServer(pWal) ){
- rc = sqlite3ServerBegin(pWal->pServer, 0);
- if( rc!=SQLITE_OK ) goto ckpt_out;
- if( eMode>=SQLITE_CHECKPOINT_RESTART ){
- /* Exclusive lock on page 1. This is exclusive access to the db. */
- rc = sqlite3ServerLock(pWal->pServer, 1, 1, 1);
- }else{
- /* Take the server write-lock ("page" 0) */
- rc = sqlite3ServerLock(pWal->pServer, 0, 1, 1);
- }
- }else{
- rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_WRITE_LOCK, 1);
- }
+ rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_WRITE_LOCK, 1);
if( rc==SQLITE_OK ){
pWal->writeLock = 1;
}else if( rc==SQLITE_BUSY ){
}
/* Release the locks. */
- ckpt_out:
sqlite3WalEndWriteTransaction(pWal);
walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1);
pWal->ckptLock = 0;
WALTRACE(("WAL%p: checkpoint %s\n", pWal, rc ? "failed" : "ok"));
- if( walIsServer(pWal) ) sqlite3ServerEnd(pWal->pServer);
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc);
}