-C Merge\strunk\soptimizations.
-D 2015-09-03T14:04:05.544
+C Changes\sfrom\sENABLE_CONCURRENT\s(default\soff)\sto\sOMIT_CONCURRENT\s(default\son).\nThis\sis\snot\sa\sclear-cut\sdecision\sand\smight\sbe\schanged\sback.
+D 2015-09-03T15:17:12.457
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in f85066ce844a28b671aaeeff320921cd0ce36239
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/backup.c 4d9134dc988a87838c06056c89c0e8c4700a0452
F src/bitvec.c d1f21d7d91690747881f03940584f4cc548c9d3d
F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
-F src/btree.c 89f97b912a959d82c1ab399da3057c93505cfa8f
+F src/btree.c 7663d05467277379fd29ae44eb82bcbdee7f618f
F src/btree.h 00d4cdb747c4172a5566faf037116985dbbc377e
-F src/btreeInt.h 171864bcd81635583dab7b8a04b19b454b18ef80
+F src/btreeInt.h df0e92901c6fbb01aa8fab3cfbcdaaba2654fd04
F src/build.c 565d84cf1d80e054e15907641985584bbd5eadf6
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
F src/os_unix.c 76f493ed71c4154338049dee1bf6e47f69c74a55
F src/os_win.c 40b3af7a47eb1107d0d69e592bec345a3b7b798a
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
-F src/pager.c 284edd20ae51f1f52a539685ce42c7a1e61ac716
-F src/pager.h 174fd2cd7091c87418616c62582a5c00cb8da2ac
+F src/pager.c 567093b5d35cba6e5a4316e1611f6bd44415c0d7
+F src/pager.h 244606cccd4293a2bc4be20bb37bf730028c5c18
F src/parse.y 1e645cacb93979c59f2a510ee2c100e769bd5e3c
F src/pcache.c cde06aa50962595e412d497e22fd2e07878ba1f0
F src/pcache.h 9968603796240cdf83da7e7bef76edf90619cea9
F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
F src/test_blob.c e5a7a81d61a780da79101aeb1e60d300af169e07
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
-F src/test_config.c f853203a1d2035370ea26ad48248f6d00a10b752
+F src/test_config.c 24f1c8415e57d709ae603cbde42a93990192c8fd
F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
F src/util.c fc612367108b74573c5fd13a85d0a23027f438bd
F src/vacuum.c 983cc3754718ef169a6ea9aef86798bd28106f21
-F src/vdbe.c 791a28761cf6176d11ec3e41cdf8e749c65384ff
+F src/vdbe.c 8e1d159743af4b17fce88037a46d68b280aaa729
F src/vdbe.h 4bc88bd0e06f8046ee6ab7487c0015e85ad949ad
F src/vdbeInt.h 8b54e01ad0463590e7cffabce0bc36da9ee4f816
F src/vdbeapi.c bda74ef4b5103d7b4a4be36f936d3cf2b56a7d6f
-F src/vdbeaux.c 33e2973796a016956887466c2b3a1991eab3af6c
+F src/vdbeaux.c 4988b83d1e1989ee554b2fa4ca18f3606a78437c
F src/vdbeblob.c 4f2e8e075d238392df98c5e03a64342465b03f90
F src/vdbemem.c ae38a0d35ae71cf604381a887c170466ba518090
F src/vdbesort.c f5009e7a35e3065635d8918b9a31f498a499976b
F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0
F src/vtab.c 2ecfe020c10e0a0c7b078203fdba2fae844744bc
F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
-F src/wal.c 00352cb9d23c5599f219496d4b22f30d4e30f8ac
-F src/wal.h ec78c303882bc04b3d0b86f0ddbc87309401595a
+F src/wal.c 5a86298540935981eea840050f66e516dbe536af
+F src/wal.h 361b16891d2772294b138054c84f5a3bad6e9d05
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
F src/where.c f0e08e4f1f66ba1a0f5b70c5161cb031ce1fb858
F src/whereInt.h 901c17c1e3c82745ad9b85b4471543fa59c980e9
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 3dea047465fa8e3031046a33016b6ed760336ddc 847387ec8e6fef283899578fb232b2c23b00ee5b
-R 7c90873b273aeaf2eed231afaea97e29
+P 71e7299e8d501618b10f8c1f78572789b1b6853a
+R cf8206aeb5613d1354992f43b08834e8
U drh
-Z 99e28d5734be346b4e9234313f30bb5e
+Z 1d56cb0a736729e62628d2ca4ac46f41
-71e7299e8d501618b10f8c1f78572789b1b6853a
\ No newline at end of file
+f8ae9bfd05abc35293ad6bc62ab1bdbe357d964e
\ No newline at end of file
#endif /* SQLITE_OMIT_SHARED_CACHE */
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
/*
** The following structure - BtreePtrmap - stores the in-memory pointer map
** used for newly allocated pages in CONCURRENT transactions. Such pages are
RollbackEntry *aRollback; /* Array of rollback entries */
};
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** If page number pgno is greater than or equal to BtreePtrmap.iFirst,
** store an entry for it in the pointer-map structure.
*/
return SQLITE_OK;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** Open savepoint iSavepoint, if it is not already open.
*/
static int btreePtrmapBegin(BtShared *pBt, int nSvpt){
return SQLITE_OK;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** Rollback (if op==SAVEPOINT_ROLLBACK) or release (if op==SAVEPOINT_RELEASE)
** savepoint iSvpt.
*/
}
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** This function is called after an CONCURRENT transaction is opened on the
** database. It allocates the BtreePtrmap structure used to track pointers
** to allocated pages and zeroes the nFree/iTrunk fields in the database
return rc;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** Free any BtreePtrmap structure allocated by an earlier call to
** btreePtrmapAllocate().
*/
pBt->pMap = 0;
}
}
-#else
+#else /* SQLITE_OMIT_CONCURRENT */
# define btreePtrmapAllocate(x) SQLITE_OK
# define btreePtrmapDelete(x)
# define btreePtrmapBegin(x,y) SQLITE_OK
# define btreePtrmapEnd(x,y,z)
-#endif
+#endif /* SQLITE_OMIT_CONCURRENT */
static void releasePage(MemPage *pPage); /* Forward reference */
/* The master-journal page number is never added to a pointer-map page */
assert( 0==PTRMAP_ISPAGE(pBt, PENDING_BYTE_PAGE(pBt)) );
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
if( pBt->pMap ){
*pRC = btreePtrmapStore(pBt, key, eType, parent);
return;
trans_begun:
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
if( bConcurrent && rc==SQLITE_OK && sqlite3PagerIsWal(pBt->pPager) ){
rc = sqlite3PagerBeginConcurrent(pBt->pPager);
if( rc==SQLITE_OK && wrflag ){
# define setChildPtrmaps(x) SQLITE_OK
#endif
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
/*
** This function is called as part of merging an CONCURRENT transaction with
** the snapshot at the head of the wal file. It relocates all pages in the
return rc;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** The b-tree handle passed as the only argument is about to commit an
** CONCURRENT transaction. At this point it is guaranteed that this is
** possible - the wal WRITER lock is held and it is known that there are
}
#else
# define btreeFixUnlocked(X) SQLITE_OK
-#endif /* ENABLE_CONCURRENT */
+#endif /* SQLITE_OMIT_CONCURRENT */
/*
** This routine does the first phase of a two-phase commit. This routine
Btree *pWriter; /* Btree with currently open write transaction */
#endif
u8 *pTmpSpace; /* Temp space sufficient to hold a single cell */
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
BtreePtrmap *pMap;
#endif
};
** (sqliteMallocRaw), it is not possible to use conditional compilation.
** So, this macro is defined instead.
*/
-#ifndef SQLITE_OMIT_AUTOVACUUM
-#define ISAUTOVACUUM (pBt->autoVacuum)
-#else
+#ifdef SQLITE_OMIT_AUTOVACUUM
#define ISAUTOVACUUM 0
+#else
+#define ISAUTOVACUUM (pBt->autoVacuum)
#endif
-#ifdef SQLITE_ENABLE_CONCURRENT
-# define ISCONCURRENT (pBt->pMap!=0)
-#else
+#ifdef SQLITE_OMIT_CONCURRENT
# define ISCONCURRENT 0
+#else
+# define ISCONCURRENT (pBt->pMap!=0)
#endif
#define REQUIRE_PTRMAP (ISAUTOVACUUM || ISCONCURRENT)
u32 cksumInit; /* Quasi-random value added to every checksum */
u32 nSubRec; /* Number of records written to sub-journal */
Bitvec *pInJournal; /* One bit for each page in the database file */
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
Bitvec *pAllRead; /* Pages read within current CONCURRENT trans. */
#endif
sqlite3_file *fd; /* File descriptor for database */
if( !pagerUseWal(pPager) ){
assert( p->eLock>=RESERVED_LOCK );
}
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
assert( pPager->dbSize==pPager->dbOrigSize || pPager->pAllRead );
#endif
assert( pPager->dbOrigSize==pPager->dbFileSize );
return rc;
}
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
/*
** If they are not already, begin recording all pages read from the pager layer
** by the b-tree layer This is used by concurrent transactions. Return
return rc;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** Stop recording all pages read from the pager layer by the b-tree layer
** and discard any current records.
*/
pPager->pAllRead = 0;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** Return true if the database is in wal mode. False otherwise.
*/
int sqlite3PagerIsWal(Pager *pPager){
return pPager->pWal!=0;
}
-#endif
+#endif /* SQLITE_OMIT_CONCURRENT */
/*
** Free the Pager.pInJournal and Pager.pAllRead bitvec objects.
rc = sqlite3WalUndo(pPager->pWal, pagerUndoCallback, (void *)pPager);
pList = sqlite3PcacheDirtyList(pPager->pPCache);
+#ifndef SQLITE_OMIT_CONCURRENT
/* If this is an CONCURRENT transaction, then page 1 must be reread from
** the db file, even if it is not dirty. This is because the b-tree layer
** may have already zeroed the nFree and iTrunk header fields. */
-#ifdef SQLITE_ENABLE_CONCURRENT
if( rc==SQLITE_OK && (pList==0 || pList->pgno!=1) && pPager->pAllRead ){
rc = pagerUndoCallback((void*)pPager, 1);
}
pPg->pDirty = 0;
if( pagerUseWal(pPager) ){
+#ifndef SQLITE_OMIT_CONCURRENT
/* If the transaction is a "BEGIN CONCURRENT" transaction, the page
** cannot be flushed to disk. Return early in this case. */
-#ifdef SQLITE_ENABLE_CONCURRENT
if( pPager->pAllRead ) return SQLITE_OK;
#endif
}
pPager->hasBeenUsed = 1;
+#ifndef SQLITE_OMIT_CONCURRENT
/* If this is an CONCURRENT transaction and the page being read was
** present in the database file when the transaction was opened,
** mark it as read in the pAllRead vector. */
-#ifdef SQLITE_ENABLE_CONCURRENT
if( pPager->pAllRead && pgno<=pPager->dbOrigSize ){
rc = sqlite3BitvecSet(pPager->pAllRead, pgno);
if( rc!=SQLITE_OK ) goto pager_acquire_err;
** to sqlite3PagerWrite(). In other words, return TRUE if it is ok
** to change the content of the page.
*/
-#if defined(SQLITE_ENABLE_CONCURRENT) || !defined(NDEBUG)
+#if !defined(SQLITE_OMIT_CONCURRENT) || !defined(NDEBUG)
int sqlite3PagerIswriteable(DbPage *pPg){
return pPg->flags & PGHDR_WRITEABLE;
}
if( 0==pagerUseWal(pPager) ){
rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
}
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
else{
if( pPager->pAllRead ){
/* This is an CONCURRENT transaction. Attempt to lock the wal database
);
}
}
-#endif
+#endif /* SQLITE_OMIT_CONCURRENT */
return rc;
}
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
/*
** This function is called as part of committing an CONCURRENT transaction.
** At this point the wal WRITER lock is held, and all pages in the cache
return rc;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** Set the in-memory cache of the database file size to nSz pages.
*/
void sqlite3PagerSetDbsize(Pager *pPager, Pgno nSz){
pPager->dbSize = nSz;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** If this is a WAL mode connection and the WRITER lock is currently held,
** relinquish it.
*/
sqlite3WalEndWriteTransaction(pPager->pWal);
}
}
-#endif /* ifdef SQLITE_ENABLE_CONCURRENT */
+#endif /* SQLITE_OMIT_CONCURRENT */
/*
void sqlite3PagerRekey(DbPage*, Pgno, u16);
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
void sqlite3PagerEndConcurrent(Pager*);
int sqlite3PagerBeginConcurrent(Pager*);
void sqlite3PagerDropExclusiveLock(Pager*);
Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "1", TCL_GLOBAL_ONLY);
#endif
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
Tcl_SetVar2(interp, "sqlite_options", "concurrent", "1", TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp, "sqlite_options", "concurrent", "0", TCL_GLOBAL_ONLY);
assert( sqlite3SchemaMutexHeld(db, pOp->p1, 0) );
pIn3 = &aMem[pOp->p3];
sqlite3VdbeMemIntegerify(pIn3);
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
if( db->bConcurrent
&& (pOp->p2==BTREE_USER_VERSION || pOp->p2==BTREE_APPLICATION_ID)
){
*/
case OP_TableLock: {
u8 isWriteLock = (u8)pOp->p3;
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
if( isWriteLock && db->bConcurrent && pOp->p2==1 ){
rc = SQLITE_ERROR;
sqlite3VdbeError(p,
}
}
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
if( db->bConcurrent && (rc & 0xFF)==SQLITE_BUSY ){
/* An SQLITE_BUSY or SQLITE_BUSY_SNAPSHOT was encountered while
** attempting to take the WRITER lock on a wal file. Release the
}
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_CONCURRENT
/*
** This function is only ever called when committing a "BEGIN CONCURRENT"
** transaction. It may be assumed that no frames have been written to
return rc;
}
-/*
+/* !defined(SQLITE_OMIT_CONCURRENT)
+**
** This function is called as part of committing an CONCURRENT transaction.
** It is assumed that sqlite3WalLockForCommit() has already been successfully
** called and so (a) the WRITER lock is held and (b) it is known that the
}
return rc;
}
-#endif /* SQLITE_ENABLE_CONCURRENT */
+#endif /* SQLITE_OMIT_CONCURRENT */
/*
** End a write transaction. The commit has already been done. This
*/
int sqlite3WalHeapMemory(Wal *pWal);
-#ifdef SQLITE_ENABLE_CONCURRENT
+#ifndef SQLITE_OMIT_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
+#endif /* SQLITE_OMIT_CONCURRENT */
#ifdef SQLITE_ENABLE_ZIPVFS
/* If the WAL file is not empty, return the number of bytes of content