From: dan Date: Mon, 14 Aug 2017 07:16:18 +0000 (+0000) Subject: Remove code for PLL support in wal mode from this branch. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e278a9bacdca1ecb7d918afdbc2742b1de60e8b4;p=thirdparty%2Fsqlite.git Remove code for PLL support in wal mode from this branch. FossilOrigin-Name: 8e1b28ed3e83eba0b2113316a40ed1165e0e051220b68863cb70734c95a82c2a --- diff --git a/manifest b/manifest index 5cedbcf9a9..4e44e1a82d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -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 @@ -442,7 +442,7 @@ F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586 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 @@ -536,7 +536,7 @@ F src/vdbesort.c fea2bea25f5e9ccd91e0760d7359f0365f9fba1aaeac7216c71cad78765f58e 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 @@ -1657,7 +1657,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 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 diff --git a/manifest.uuid b/manifest.uuid index 2e4547d930..a6a976c08a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -bc2498d60fa22b587ad463ec697abe82d1c87abb7fd0d2cb60cc7316cfd7cec7 \ No newline at end of file +8e1b28ed3e83eba0b2113316a40ed1165e0e051220b68863cb70734c95a82c2a \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index aee02c013d..c45fe29c74 100644 --- a/src/pager.c +++ b/src/pager.c @@ -7694,9 +7694,6 @@ int sqlite3PagerOpenWal( if( rc==SQLITE_OK ){ pPager->journalMode = PAGER_JOURNALMODE_WAL; pPager->eState = PAGER_OPEN; -#ifdef SQLITE_SERVER_EDITION - sqlite3WalServer(pPager->pWal, pPager->pServer); -#endif } }else{ *pbOpen = 1; diff --git a/src/wal.c b/src/wal.c index 7f000676c6..09f605fe57 100644 --- a/src/wal.c +++ b/src/wal.c @@ -454,17 +454,8 @@ struct Wal { #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. */ @@ -1270,14 +1261,6 @@ static void walIndexClose(Wal *pWal, int isDelete){ } } -#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 @@ -1909,9 +1892,6 @@ static int walCheckpoint( ** 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); } @@ -2071,14 +2051,6 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){ 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 @@ -2119,12 +2091,11 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ 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); @@ -2138,9 +2109,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ } } pWal->writeLock = 0; - if( walIsServer(pWal)==0 ){ - walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); - } + walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1); } } @@ -2280,9 +2249,6 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ } } - assert( rc==SQLITE_OK ); - if( walIsServer(pWal) ) return SQLITE_OK; - pInfo = walCkptInfo(pWal); if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame #ifdef SQLITE_ENABLE_SNAPSHOT @@ -2622,15 +2588,7 @@ int sqlite3WalFindFrame( 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 @@ -2742,7 +2700,7 @@ int sqlite3WalReadFrame( ** 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; @@ -2767,18 +2725,13 @@ int sqlite3WalBeginWriteTransaction(Wal *pWal){ /* 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. */ @@ -2829,7 +2782,7 @@ int sqlite3WalEndWriteTransaction(Wal *pWal){ */ 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; @@ -2919,13 +2872,11 @@ int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData){ ** 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; @@ -2947,7 +2898,6 @@ static int walRestartLog(Wal *pWal){ return rc; } } - if( walIsServer(pWal) ) return rc; walUnlockShared(pWal, WAL_READ_LOCK(0)); pWal->readLock = -1; cnt = 0; @@ -3108,23 +3058,7 @@ int sqlite3WalFrames( 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. */ @@ -3145,7 +3079,7 @@ int sqlite3WalFrames( /* 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; } @@ -3397,19 +3331,7 @@ int sqlite3WalCheckpoint( ** 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 ){ @@ -3454,12 +3376,10 @@ int sqlite3WalCheckpoint( } /* 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); }