]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Change "BEGIN UNLOCKED" to "BEGIN CONCURRENT".
authordan <dan@noemail.net>
Mon, 24 Aug 2015 19:56:04 +0000 (19:56 +0000)
committerdan <dan@noemail.net>
Mon, 24 Aug 2015 19:56:04 +0000 (19:56 +0000)
FossilOrigin-Name: ba1ab858e2997c88dd7eee6e6893a8616d85c665

18 files changed:
manifest
manifest.uuid
src/btree.c
src/btreeInt.h
src/build.c
src/pager.c
src/pager.h
src/parse.y
src/sqliteInt.h
src/test_config.c
src/vacuum.c
src/vdbe.c
src/vdbeaux.c
src/wal.c
test/concurrent.test [moved from test/unlocked.test with 85% similarity]
test/concurrent2.test [moved from test/unlocked2.test with 87% similarity]
test/concurrent3.test [moved from test/unlocked3.test with 93% similarity]
tool/mkkeywordhash.c

index c33005f21ea1650410d55769f26e894ec446330d..ceae322d8ac18fefcf138d13cdc4ab441fbb550b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\shandling\sof\sattempts\sto\smodify\sthe\sdatabase\sschema,\sapplication_id\sor\suser_version\swithin\san\sUNLOCKED\stransaction.
-D 2015-08-24T19:08:10.037
+C Change\s"BEGIN\sUNLOCKED"\sto\s"BEGIN\sCONCURRENT".
+D 2015-08-24T19:56:04.567
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in e2218eb228374422969de7b1680eda6864affcef
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -279,10 +279,10 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
 F src/backup.c 4d9134dc988a87838c06056c89c0e8c4700a0452
 F src/bitvec.c d1f21d7d91690747881f03940584f4cc548c9d3d
 F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
-F src/btree.c 13f924763ebd6bd55e0b74d139ee363a42abbe0f
+F src/btree.c f4db20fab7bf5ebd9f12ef7e3a925ca3c2c34fa8
 F src/btree.h 00d4cdb747c4172a5566faf037116985dbbc377e
-F src/btreeInt.h 0c19847f87ab82e4f5e67750a069f10829475da6
-F src/build.c e47b6fffe14a28d9050e6747beebb01597d37542
+F src/btreeInt.h 171864bcd81635583dab7b8a04b19b454b18ef80
+F src/build.c 2890c89e0dc274171c18195ff2a6364be47c2b1d
 F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
 F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
 F src/ctime.c 5a0b735dc95604766f5dac73973658eef782ee8b
@@ -324,9 +324,9 @@ F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
 F src/os_unix.c 388c023582b17890f10c980b30ec1922b471753b
 F src/os_win.c 40b3af7a47eb1107d0d69e592bec345a3b7b798a
 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
-F src/pager.c 57e5775ba3d8059e37e760f8a6f064079196eb9d
-F src/pager.h 1e7b0fc3846b71bd95b4b3300820d756895cb4ef
-F src/parse.y e9accdb2cb1795f75f478e7ce89e17b19d7d4da7
+F src/pager.c 2e2559e64e825e39c033c0744237733cec70d636
+F src/pager.h 1335b624cd540815c8c977172589d208d1c251a6
+F src/parse.y dc3dda4b191ed54ae7d3662ffc9ee21ba91850ae
 F src/pcache.c cde06aa50962595e412d497e22fd2e07878ba1f0
 F src/pcache.h 9968603796240cdf83da7e7bef76edf90619cea9
 F src/pcache1.c a3fe31b17e841ec70beee72a2c960e9c787a8857
@@ -342,7 +342,7 @@ F src/shell.c b1f91e60918df3a68efad1e3a11696b9a7e23d23
 F src/sqlite.h.in 378bebc8fe6a88bade25e5f23b7e6123fdc64b00
 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
 F src/sqlite3ext.h f700e6a9dd1fdcccc9951ab022b366fb66b9e413
-F src/sqliteInt.h d4963f5f6b985b8f967be8e6e103be3cf36f1f42
+F src/sqliteInt.h 54c3393fc26737db60ed369881d91fa54b71987d
 F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
 F src/status.c f266ad8a2892d659b74f0f50cb6a88b6e7c12179
 F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
@@ -361,7 +361,7 @@ F src/test_autoext.c dea8a01a7153b9adc97bd26161e4226329546e12
 F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
 F src/test_blob.c e5a7a81d61a780da79101aeb1e60d300af169e07
 F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
-F src/test_config.c 8870dbb8809e2bf7f766828934db7d70c907f346
+F src/test_config.c f853203a1d2035370ea26ad48248f6d00a10b752
 F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
 F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
 F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f
@@ -399,19 +399,19 @@ F src/trigger.c 322f23aad694e8f31d384dcfa386d52a48d3c52f
 F src/update.c 487747b328b7216bb7f6af0695d6937d5c9e605f
 F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
 F src/util.c bc9dd64b5db544218b871b66243871c202b2781f
-F src/vacuum.c d35c7291e94a470ee47695c22559a69aef9fdda1
-F src/vdbe.c cb555e4a802ec96e16f48c54b57bf15b94616567
+F src/vacuum.c 983cc3754718ef169a6ea9aef86798bd28106f21
+F src/vdbe.c 84ac0688d7e1921d8e802f2e4e1a38273e069d0c
 F src/vdbe.h 7a75045d879118b9d3af7e8b3c108f2f27c51473
 F src/vdbeInt.h 8b54e01ad0463590e7cffabce0bc36da9ee4f816
 F src/vdbeapi.c bda74ef4b5103d7b4a4be36f936d3cf2b56a7d6f
-F src/vdbeaux.c 5a07e354850fcc96c535f9b0b6ded4c705483a01
+F src/vdbeaux.c 9c59b0604489ebe62869a59f3b627c822d32b278
 F src/vdbeblob.c 4f2e8e075d238392df98c5e03a64342465b03f90
 F src/vdbemem.c ae38a0d35ae71cf604381a887c170466ba518090
 F src/vdbesort.c f5009e7a35e3065635d8918b9a31f498a499976b
 F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0
 F src/vtab.c d31174e4c8f592febab3fa7f69e18320b4fd657a
 F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
-F src/wal.c fd9a3b9fa79042377f3e5e42a91fd6e0daf1037e
+F src/wal.c a21412a803f0eafecf48e707fb97c64368a0d267
 F src/wal.h 903ef67e17f8b466dc7cfc4186fc23e80be10ff8
 F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
 F src/where.c 66518a14a1238611aa0744d6980b6b7f544f4816
@@ -523,6 +523,9 @@ F test/collate9.test 3adcc799229545940df2f25308dd1ad65869145a
 F test/collateA.test b8218ab90d1fa5c59dcf156efabb1b2599c580d6
 F test/colmeta.test 2c765ea61ee37bc43bbe6d6047f89004e6508eb1
 F test/colname.test 08948a4809d22817e0e5de89c7c0a8bd90cb551b
+F test/concurrent.test 631e398b127a13ddfbcc8e64f438d9f82b261ffe w test/unlocked.test
+F test/concurrent2.test 21a15630192ba92287070a1a58a6e497d393c55d w test/unlocked2.test
+F test/concurrent3.test 7dcf81372c06cbac58e7e630aebf7292945947bb w test/unlocked3.test
 F test/conflict.test 841bcf7cabbfca39c577eb8411ea8601843b46a8
 F test/conflict2.test 0d3af4fb534fa1bd020c79960bb56e4d52655f09
 F test/conflict3.test dec0634c0f31dec9a4b01c63063e939f0cd21b6b
@@ -1227,9 +1230,6 @@ F test/types3.test 99e009491a54f4dc02c06bdbc0c5eea56ae3e25a
 F test/unique.test 93f8b2ef5ea51b9495f8d6493429b1fd0f465264
 F test/unique2.test 41e7f83c6827605991160a31380148a9fc5f1339
 F test/unixexcl.test cd6c765f75e50e8e2c2ba763149e5d340ea19825
-F test/unlocked.test fecdc8d76e3495664c74961e6cd1aef9b59439c1
-F test/unlocked2.test 2d969d1b4c3e832169d0c97f522fa5955877785a
-F test/unlocked3.test 6c99bc0c3f19ad8ca8c1632b09b089164718dc35
 F test/unordered.test ca7adce0419e4ca0c50f039885e76ed2c531eda8
 F test/update.test 6c68446b8a0a33d522a7c72b320934596a2d7d32
 F test/uri.test 23662b7b61958b0f0e47082de7d06341ccf85d5b
@@ -1341,7 +1341,7 @@ F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
 F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
 F tool/mkautoconfamal.sh d1a2da0e15b2ed33d60af35c7e9d483f13a8eb9f
-F tool/mkkeywordhash.c de4a823fe66f9e8c39c86e465ac7285fd6935bb8
+F tool/mkkeywordhash.c 8d78ea188240bc08ec080adf3af84717f013e69a
 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
 F tool/mkpragmatab.tcl 84af2b180484323a2ea22a2279e8bd9e3e1e492e
 F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
@@ -1381,7 +1381,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 041135575417201bbcf0544cc69dcb7369c7fb34
-R c0f10d85f21cf03acdf9208c7581f1d4
+P 5b9f272113d21fd606903509d6f830fe60fac039
+R 7a2246f9f176c887e1e1da04647372c5
 U dan
-Z 17437f740072ebd0dda6cab278d01c48
+Z f0bce293b4f554fd07229d405fb3ff97
index e52ba34ef972bc35d2bab4ef54fbaff60a5e854d..e856c7e3959fdbf8790b13af145d805e6485e625 100644 (file)
@@ -1 +1 @@
-5b9f272113d21fd606903509d6f830fe60fac039
\ No newline at end of file
+ba1ab858e2997c88dd7eee6e6893a8616d85c665
\ No newline at end of file
index 8a99dbde1494fb5632d696688385dce64568cc9f..e391255a418a96fa5a8d51ceaa91f1ecb4d2748d 100644 (file)
@@ -440,10 +440,10 @@ static void downgradeAllSharedCacheTableLocks(Btree *p){
 #endif /* SQLITE_OMIT_SHARED_CACHE */
 
 
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
 /*
 ** The following structure - BtreePtrmap - stores the in-memory pointer map
-** used for newly allocated pages in UNLOCKED transactions. Such pages are
+** used for newly allocated pages in CONCURRENT transactions. Such pages are
 ** always allocated in a contiguous block (from the end of the file) starting
 ** with page BtreePtrmap.iFirst.
 */
@@ -588,7 +588,7 @@ static void btreePtrmapEnd(BtShared *pBt, int op, int iSvpt){
 }
 
 /*
-** This function is called after an UNLOCKED transaction is opened on the
+** 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 
 ** header on page 1.
@@ -596,7 +596,7 @@ static void btreePtrmapEnd(BtShared *pBt, int op, int iSvpt){
 static int btreePtrmapAllocate(BtShared *pBt){
   int rc = SQLITE_OK;
   BtreePtrmap *pMap = sqlite3_malloc(sizeof(BtreePtrmap));
-  assert( pBt->pMap==0 && sqlite3PagerIsUnlocked(pBt->pPager) );
+  assert( pBt->pMap==0 && sqlite3PagerIsConcurrent(pBt->pPager) );
   if( pMap==0 ){
     rc = SQLITE_NOMEM;
   }else{
@@ -1074,7 +1074,7 @@ static void ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent, int *pRC){
   /* 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_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
   if( pBt->pMap ){
     *pRC = btreePtrmapStore(pBt, key, eType, parent);
     return;
@@ -3339,15 +3339,15 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
       if( (pBt->btsFlags & BTS_READ_ONLY)!=0 ){
         rc = SQLITE_READONLY;
       }else{
-        int exFlag = (p->db->bUnlocked && !ISAUTOVACUUM) ? -1 : (wrflag>1);
+        int exFlag = (p->db->bConcurrent && !ISAUTOVACUUM) ? -1 : (wrflag>1);
         int bSubjInMem = sqlite3TempInMemory(p->db);
-        assert( p->db->bUnlocked==0 || wrflag==1 );
+        assert( p->db->bConcurrent==0 || wrflag==1 );
         rc = sqlite3PagerBegin(pBt->pPager, exFlag, bSubjInMem);
         if( rc==SQLITE_OK ){
           rc = newDatabase(pBt);
         }
-#ifdef SQLITE_ENABLE_UNLOCKED
-        if( rc==SQLITE_OK && sqlite3PagerIsUnlocked(pBt->pPager) ){
+#ifdef SQLITE_ENABLE_CONCURRENT
+        if( rc==SQLITE_OK && sqlite3PagerIsConcurrent(pBt->pPager) ){
           rc = btreePtrmapAllocate(pBt);
         }
 #endif
@@ -3848,9 +3848,9 @@ static int autoVacuumCommit(BtShared *pBt){
 # define setChildPtrmaps(x) SQLITE_OK
 #endif
 
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
 /*
-** This function is called as part of merging an UNLOCKED transaction with
+** 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
 ** range iFirst..iLast, inclusive. It is assumed that the BtreePtrmap 
 ** structure at BtShared.pMap contains the location of the pointers to each
@@ -3918,7 +3918,7 @@ static int btreeRelocateRange(
 
 /*
 ** The b-tree handle passed as the only argument is about to commit an
-** UNLOCKED transaction. At this point it is guaranteed that this is 
+** 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 
 ** no conflicts with committed transactions.
 */
@@ -3937,7 +3937,7 @@ static int btreeFixUnlocked(Btree *p){
   Pgno nPage = btreePagecount(pBt);
   u32 nFree = get4byte(&p1[36]);
 
-  assert( sqlite3PagerIsUnlocked(pPager) );
+  assert( sqlite3PagerIsConcurrent(pPager) );
   assert( pBt->pMap );
   rc = sqlite3PagerUpgradeSnapshot(pPager, pPage1->pDbPage);
   assert( p1==pPage1->aData );
@@ -3967,7 +3967,7 @@ static int btreeFixUnlocked(Btree *p){
 
       if( nHPage<(pMap->iFirst-1) ){
         /* The database consisted of (pMap->iFirst-1) pages when the current
-        ** unlocked transaction was opened. And an unlocked transaction may
+        ** concurrent transaction was opened. And an concurrent transaction may
         ** not be executed on an auto-vacuum database - so the db should 
         ** not have shrunk since the transaction was opened. Therefore nHPage
         ** should be set to (pMap->iFirst-1) or greater. */
@@ -4042,7 +4042,7 @@ int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
 
 #ifndef SQLITE_OMIT_AUTOVACUUM
     if( pBt->autoVacuum ){
-      assert( ISUNLOCKED==0 );
+      assert( ISCONCURRENT==0 );
       rc = autoVacuumCommit(pBt);
       if( rc!=SQLITE_OK ){
         sqlite3BtreeLeave(p);
@@ -4053,7 +4053,7 @@ int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){
       sqlite3PagerTruncateImage(pBt->pPager, pBt->nPage);
     }
 #endif
-    if( rc==SQLITE_OK && ISUNLOCKED ){
+    if( rc==SQLITE_OK && ISCONCURRENT ){
       rc = btreeFixUnlocked(p);
     }
     if( rc==SQLITE_OK ){
@@ -4101,7 +4101,7 @@ static void btreeEndTransaction(Btree *p){
     unlockBtreeIfUnused(pBt);
   }
 
-  /* If this was an UNLOCKED transaction, delete the pBt->pMap object */
+  /* If this was an CONCURRENT transaction, delete the pBt->pMap object */
   btreePtrmapDelete(pBt);
   btreeIntegrity(p);
 }
@@ -5860,14 +5860,14 @@ static int allocateBtreePage(
   ** stores stores the total number of pages on the freelist. */
   n = get4byte(&pPage1->aData[36]);
   testcase( n==mxPage-1 );
-  if( ISUNLOCKED==0 && n>=mxPage ){
+  if( ISCONCURRENT==0 && n>=mxPage ){
     return SQLITE_CORRUPT_BKPT;
   }
 
   /* Ensure page 1 is writable. This function will either change the number
   ** of pages in the free-list or the size of the database file. Since both
   ** of these operations involve modifying page 1 header fields, page 1
-  ** will definitely be written by this transaction. If this is an UNLOCKED
+  ** will definitely be written by this transaction. If this is an CONCURRENT
   ** transaction, ensure the BtreePtrmap structure has been allocated.  */
   rc = sqlite3PagerWrite(pPage1->pDbPage);
   if( rc ) return rc;
@@ -5883,7 +5883,7 @@ static int allocateBtreePage(
     ** the entire-list will be searched for that page.
     */
     if( eMode==BTALLOC_EXACT ){
-      assert( ISAUTOVACUUM!=ISUNLOCKED );
+      assert( ISAUTOVACUUM!=ISCONCURRENT );
       if( ISAUTOVACUUM ){
         if( nearby<=mxPage ){
           u8 eType;
@@ -9974,14 +9974,14 @@ int sqlite3HeaderSizeBtree(void){ return ROUND8(sizeof(MemPage)); }
 ** current write-transaction to the database file are held. If the db is
 ** in rollback mode, this means the EXCLUSIVE lock on the database file.
 **
-** Or, if this is an UNLOCKED transaction on a wal-mode database, the WRITER
+** Or, if this is an CONCURRENT transaction on a wal-mode database, the WRITER
 ** lock on the wal file. In this case this function also checks that the
-** UNLOCKED transaction can be safely committed (does not commit with any
+** CONCURRENT transaction can be safely committed (does not commit with any
 ** other transaction committed since it was opened).
 **
 ** SQLITE_OK is returned if successful. SQLITE_BUSY if the required locks
 ** cannot be obtained due to a conflicting lock. If the locks cannot be
-** obtained for an UNLOCKED transaction due to a conflict with an already
+** obtained for an CONCURRENT transaction due to a conflict with an already
 ** committed transaction, SQLITE_BUSY_SNAPSHOT is returned. Otherwise, if
 ** some other error (OOM, IO, etc.) occurs, the relevant SQLite error code
 ** is returned.
index 4c23629cc8445a56342f667f35215c11b2956d46..e686466e81a49c646d756d7c08c9419754bbb7a8 100644 (file)
@@ -448,7 +448,7 @@ struct BtShared {
   Btree *pWriter;       /* Btree with currently open write transaction */
 #endif
   u8 *pTmpSpace;        /* Temp space sufficient to hold a single cell */
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
   BtreePtrmap *pMap;
 #endif
 };
@@ -663,13 +663,13 @@ struct BtCursor {
 #define ISAUTOVACUUM 0
 #endif
 
-#ifdef SQLITE_ENABLE_UNLOCKED
-# define ISUNLOCKED (pBt->pMap!=0)
+#ifdef SQLITE_ENABLE_CONCURRENT
+# define ISCONCURRENT (pBt->pMap!=0)
 #else
-# define ISUNLOCKED 0
+# define ISCONCURRENT 0
 #endif
 
-#define REQUIRE_PTRMAP (ISAUTOVACUUM || ISUNLOCKED)
+#define REQUIRE_PTRMAP (ISAUTOVACUUM || ISCONCURRENT)
 
 /*
 ** This structure is passed around through all the sanity checking routines
index ed216cb292a6f3f73cda469d1262fb897aaee245..d37ddde269d21c2a32fb6c78522b64d906266f84 100644 (file)
@@ -3862,7 +3862,7 @@ void sqlite3BeginTransaction(Parse *pParse, int type){
       sqlite3VdbeUsesBtree(v, i);
     }
   }
-  sqlite3VdbeAddOp3(v, OP_AutoCommit, 0, 0, (type==TK_UNLOCKED));
+  sqlite3VdbeAddOp3(v, OP_AutoCommit, 0, 0, (type==TK_CONCURRENT));
 }
 
 /*
index 9942211edb410eca388aac3ef30b28b9b11d9369..ecdad403dcde8d9d5b2d507bb6e69955ede4cb11 100644 (file)
@@ -657,8 +657,8 @@ struct Pager {
   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_UNLOCKED
-  Bitvec *pAllRead;           /* Pages read within current UNLOCKED trans. */
+#ifdef SQLITE_ENABLE_CONCURRENT
+  Bitvec *pAllRead;           /* Pages read within current CONCURRENT trans. */
 #endif
   sqlite3_file *fd;           /* File descriptor for database */
   sqlite3_file *jfd;          /* File descriptor for main journal */
@@ -1747,7 +1747,7 @@ static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){
 static void pagerFreeBitvecs(Pager *pPager){
   sqlite3BitvecDestroy(pPager->pInJournal);
   pPager->pInJournal = 0;
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
   sqlite3BitvecDestroy(pPager->pAllRead);
   pPager->pAllRead = 0;
 #endif
@@ -3035,10 +3035,10 @@ static int pagerRollbackWal(Pager *pPager){
   rc = sqlite3WalUndo(pPager->pWal, pagerUndoCallback, (void *)pPager);
   pList = sqlite3PcacheDirtyList(pPager->pPCache);
 
-  /* If this is an UNLOCKED transaction, then page 1 must be reread from 
+  /* 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_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
   if( rc==SQLITE_OK && (pList==0 || pList->pgno!=1) && pPager->pAllRead ){
     rc = pagerUndoCallback((void*)pPager, 1);
   }
@@ -4452,9 +4452,9 @@ static int pagerStress(void *p, PgHdr *pPg){
 
   pPg->pDirty = 0;
   if( pagerUseWal(pPager) ){
-    /* If the transaction is a "BEGIN UNLOCKED" transaction, the page 
+    /* If the transaction is a "BEGIN CONCURRENT" transaction, the page 
     ** cannot be flushed to disk. Return early in this case. */
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
     if( pPager->pAllRead ) return SQLITE_OK;
 #endif
 
@@ -5298,10 +5298,10 @@ int sqlite3PagerAcquire(
   }
   pPager->hasBeenUsed = 1;
 
-  /* If this is an UNLOCKED transaction and the page being read was
+  /* 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_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
   if( pPager->pAllRead && pgno<=pPager->dbOrigSize ){
     rc = sqlite3BitvecSet(pPager->pAllRead, pgno);
     if( rc!=SQLITE_OK ) goto pager_acquire_err;
@@ -5593,7 +5593,7 @@ static int pager_open_journal(Pager *pPager){
 ** functions need be called.
 **
 ** If (exFlag<0) and the database is in WAL mode, do not take any locks.
-** The transaction will run in UNLOCKED mode instead.
+** The transaction will run in CONCURRENT mode instead.
 **
 ** If the subjInMemory argument is non-zero, then any sub-journal opened
 ** within this transaction will be opened as an in-memory file. This
@@ -5612,7 +5612,7 @@ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
 
   if( ALWAYS(pPager->eState==PAGER_READER) ){
     assert( pPager->pInJournal==0 );
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
     assert( pPager->pAllRead==0 );
 #endif
 
@@ -5633,7 +5633,7 @@ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
       ** The busy-handler is not invoked if another connection already
       ** holds the write-lock. If possible, the upper layer will call it.
       */
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
       if( exFlag<0 ){
         pPager->pAllRead = sqlite3BitvecCreate(pPager->dbSize);
         if( pPager->pAllRead==0 ){
@@ -5949,7 +5949,7 @@ int sqlite3PagerWrite(PgHdr *pPg){
 ** to sqlite3PagerWrite().  In other words, return TRUE if it is ok
 ** to change the content of the page.
 */
-#if defined(SQLITE_ENABLE_UNLOCKED) || !defined(NDEBUG)
+#if defined(SQLITE_ENABLE_CONCURRENT) || !defined(NDEBUG)
 int sqlite3PagerIswriteable(DbPage *pPg){
   return pPg->flags & PGHDR_WRITEABLE;
 }
@@ -6105,10 +6105,10 @@ int sqlite3PagerSync(Pager *pPager, const char *zMaster){
 ** current write-transaction to the database file are held. If the db is
 ** in rollback mode, this means the EXCLUSIVE lock on the database file.
 **
-** Or, if this is a non-UNLOCKED transaction on a wal-mode database, this
+** Or, if this is a non-CONCURRENT transaction on a wal-mode database, this
 ** function is a no-op.
 **
-** If this is an UNLOCKED transaction on a wal-mode database, this function
+** If this is an CONCURRENT transaction on a wal-mode database, this function
 ** attempts to obtain the WRITER lock on the wal file and also checks to
 ** see that the transaction can be safely committed (does not commit with 
 ** any other transaction committed since it was opened).
@@ -6116,7 +6116,7 @@ int sqlite3PagerSync(Pager *pPager, const char *zMaster){
 ** If the required locks are already held or successfully obtained and
 ** the transaction can be committed, SQLITE_OK is returned. If a required lock
 ** cannot be obtained, SQLITE_BUSY is returned. Or, if the current transaction
-** is UNLOCKED and cannot be committed due to a conflict, SQLITE_BUSY_SNAPSHOT
+** is CONCURRENT and cannot be committed due to a conflict, SQLITE_BUSY_SNAPSHOT
 ** is returned. Otherwise, if some other error occurs (IO error, OOM etc.),
 ** and SQLite error code is returned.
 */
@@ -6130,10 +6130,10 @@ int sqlite3PagerExclusiveLock(Pager *pPager, PgHdr *pPage1){
   if( 0==pagerUseWal(pPager) ){
     rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
   }
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
   else{
     if( pPager->pAllRead ){
-      /* This is an UNLOCKED transaction. Attempt to lock the wal database
+      /* This is an CONCURRENT transaction. Attempt to lock the wal database
       ** here. If SQLITE_BUSY (but not SQLITE_BUSY_SNAPSHOT) is returned,
       ** invoke the busy-handler and try again for as long as it returns
       ** non-zero.  */
@@ -6148,9 +6148,9 @@ int sqlite3PagerExclusiveLock(Pager *pPager, PgHdr *pPage1){
   return rc;
 }
 
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
 /*
-** This function is called as part of committing an UNLOCKED transaction.
+** 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 
 ** except for page 1 are compatible with the snapshot at the head of the
 ** wal file. 
@@ -6185,9 +6185,9 @@ void sqlite3PagerSetDbsize(Pager *pPager, Pgno nSz){
 }
 
 /*
-** Return true if this pager is currently within an UNLOCKED transaction.
+** Return true if this pager is currently within an CONCURRENT transaction.
 */
-int sqlite3PagerIsUnlocked(Pager *pPager){
+int sqlite3PagerIsConcurrent(Pager *pPager){
   return pPager->pAllRead!=0;
 }
 
@@ -6200,7 +6200,7 @@ void sqlite3PagerDropExclusiveLock(Pager *pPager){
     sqlite3WalEndWriteTransaction(pPager->pWal);
   }
 }
-#endif   /* ifdef SQLITE_ENABLE_UNLOCKED */
+#endif   /* ifdef SQLITE_ENABLE_CONCURRENT */
 
 
 /*
index c097c97c5b6a611d524be5a4fdf8e8a0cacdf314..c9ebaf11165f8f9f45027d42af656e1ddd9ac6cc 100644 (file)
@@ -195,7 +195,7 @@ void sqlite3PagerTruncateImage(Pager*,Pgno);
 void sqlite3PagerRekey(DbPage*, Pgno, u16);
 
 void sqlite3PagerDropExclusiveLock(Pager*);
-int sqlite3PagerIsUnlocked(Pager*);
+int sqlite3PagerIsConcurrent(Pager*);
 int sqlite3PagerIswriteable(DbPage*);
 int sqlite3PagerUpgradeSnapshot(Pager *pPager, DbPage*);
 void sqlite3PagerSetDbsize(Pager *pPager, Pgno);
index 2dd58bdf5522b09045a104adadf7f5a9d30e4a4b..1fc72f753d6d3b2f6e3ddbd71c5ee21d11ab28f9 100644 (file)
@@ -121,7 +121,7 @@ transtype(A) ::= .             {A = TK_DEFERRED;}
 transtype(A) ::= DEFERRED(X).  {A = @X;}
 transtype(A) ::= IMMEDIATE(X). {A = @X;}
 transtype(A) ::= EXCLUSIVE(X). {A = @X;}
-transtype(A) ::= UNLOCKED(X).  {A = @X;}
+transtype(A) ::= CONCURRENT(X).  {A = @X;}
 cmd ::= COMMIT trans_opt.      {sqlite3CommitTransaction(pParse);}
 cmd ::= END trans_opt.         {sqlite3CommitTransaction(pParse);}
 cmd ::= ROLLBACK trans_opt.    {sqlite3RollbackTransaction(pParse);}
index 2d295b01fa789267469e1223c5e5a709470a9763..39931f0870f0f99638556376b467c0482f819d14 100644 (file)
@@ -1150,7 +1150,7 @@ struct sqlite3 {
   u16 dbOptFlags;               /* Flags to enable/disable optimizations */
   u8 enc;                       /* Text encoding */
   u8 autoCommit;                /* The auto-commit flag. */
-  u8 bUnlocked;                 /* Current transaction is "UNLOCKED" */
+  u8 bConcurrent;               /* Current transaction is "CONCURRENT" */
   u8 temp_store;                /* 1: file 2: memory 0: default */
   u8 mallocFailed;              /* True if we have seen a malloc failure */
   u8 dfltLockMode;              /* Default locking-mode for attached dbs */
index 4d2dece83a4bab620ee9321bba8168b15eee8f5c..d15369771579fc893cbeb339fd05fd3d6c2bd197 100644 (file)
@@ -573,10 +573,10 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
   Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "1", TCL_GLOBAL_ONLY);
 #endif
 
-#ifdef SQLITE_ENABLE_UNLOCKED
-  Tcl_SetVar2(interp, "sqlite_options", "unlocked", "1", TCL_GLOBAL_ONLY);
+#ifdef SQLITE_ENABLE_CONCURRENT
+  Tcl_SetVar2(interp, "sqlite_options", "concurrent", "1", TCL_GLOBAL_ONLY);
 #else
-  Tcl_SetVar2(interp, "sqlite_options", "unlocked", "0", TCL_GLOBAL_ONLY);
+  Tcl_SetVar2(interp, "sqlite_options", "concurrent", "0", TCL_GLOBAL_ONLY);
 #endif
 
 #ifdef SQLITE_OMIT_UTF16
index 46f2249ebb560424a066d6bb8f61e4a50bdd2281..eafaa661651349350d129283851c428ad916e40c 100644 (file)
@@ -356,7 +356,7 @@ end_of_vacuum:
   ** is closed by the DETACH.
   */
   db->autoCommit = 1;
-  assert( db->bUnlocked==0 );
+  assert( db->bConcurrent==0 );
 
   if( pDb ){
     sqlite3BtreeClose(pDb->pBt);
index 3cdb252fdf8aa314a5f4cacdca85ff85b07060d5..67703a781ac7fe60ad8a41f5754ff8b90e10c949 100644 (file)
@@ -2895,7 +2895,7 @@ case OP_Savepoint: {
       ** is committed. 
       */
       int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint;
-      assert( db->bUnlocked==0 || db->isTransactionSavepoint==0 );
+      assert( db->bConcurrent==0 || db->isTransactionSavepoint==0 );
       if( isTransaction && p1==SAVEPOINT_RELEASE ){
         if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){
           goto vdbe_return;
@@ -2979,7 +2979,7 @@ case OP_Savepoint: {
 ** there are active writing VMs or active VMs that use shared cache.
 **
 ** If P3 is non-zero, then this instruction is being executed as part of
-** a "BEGIN UNLOCKED" command.
+** a "BEGIN CONCURRENT" command.
 **
 ** This instruction causes the VM to halt.
 */
@@ -2987,25 +2987,25 @@ case OP_AutoCommit: {
   int desiredAutoCommit;
   int iRollback;
   int turnOnAC;
-  int bUnlocked;
+  int bConcurrent;
   int hrc;
 
   desiredAutoCommit = pOp->p1;
   iRollback = pOp->p2;
-  bUnlocked = pOp->p3;
+  bConcurrent = pOp->p3;
   turnOnAC = desiredAutoCommit && !db->autoCommit;
   assert( desiredAutoCommit==1 || desiredAutoCommit==0 );
   assert( desiredAutoCommit==1 || iRollback==0 );
-  assert( desiredAutoCommit==0 || bUnlocked==0 );
-  assert( db->autoCommit==0 || db->bUnlocked==0 );
+  assert( desiredAutoCommit==0 || bConcurrent==0 );
+  assert( db->autoCommit==0 || db->bConcurrent==0 );
   assert( db->nVdbeActive>0 );  /* At least this one VM is active */
   assert( p->bIsReader );
 
   if( turnOnAC && !iRollback 
-   && (db->nVdbeWrite>0 || (db->bUnlocked && db->nVdbeActive>1))
+   && (db->nVdbeWrite>0 || (db->bConcurrent && db->nVdbeActive>1))
   ){
     /* A transaction may only be committed if there are no other active
-    ** writer VMs. If the transaction is UNLOCKED, then it may only be
+    ** writer VMs. If the transaction is CONCURRENT, then it may only be
     ** committed if there are no active VMs at all (readers or writers).
     **
     ** If this instruction is a COMMIT and the transaction may not be
@@ -3020,7 +3020,7 @@ case OP_AutoCommit: {
       assert( desiredAutoCommit==1 );
       sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK);
       db->autoCommit = 1;
-      db->bUnlocked = 0;
+      db->bConcurrent = 0;
     }else if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){
       goto vdbe_return;
     }else{
@@ -3034,7 +3034,7 @@ case OP_AutoCommit: {
       rc = SQLITE_BUSY;
       goto vdbe_return;
     }
-    db->bUnlocked = (u8)bUnlocked;
+    db->bConcurrent = (u8)bConcurrent;
     assert( db->nStatement==0 );
     sqlite3CloseSavepoints(db);
     if( p->rc==SQLITE_OK ){
@@ -3227,12 +3227,12 @@ case OP_SetCookie: {       /* in3 */
   assert( sqlite3SchemaMutexHeld(db, pOp->p1, 0) );
   pIn3 = &aMem[pOp->p3];
   sqlite3VdbeMemIntegerify(pIn3);
-#ifdef SQLITE_ENABLE_UNLOCKED
-  if( db->bUnlocked 
+#ifdef SQLITE_ENABLE_CONCURRENT
+  if( db->bConcurrent 
    && (pOp->p2==BTREE_USER_VERSION || pOp->p2==BTREE_APPLICATION_ID)
   ){
     rc = SQLITE_ERROR;
-    sqlite3VdbeError(p, "cannot modify %s within UNLOCKED transaction",
+    sqlite3VdbeError(p, "cannot modify %s within CONCURRENT transaction",
         pOp->p2==BTREE_USER_VERSION ? "user_version" : "application_id"
     );
     break; 
@@ -3242,7 +3242,7 @@ case OP_SetCookie: {       /* in3 */
   rc = sqlite3BtreeUpdateMeta(pDb->pBt, pOp->p2, (int)pIn3->u.i);
   if( pOp->p2==BTREE_SCHEMA_VERSION ){
     /* When the schema cookie changes, record the new cookie internally */
-    assert( db->bUnlocked==0 );
+    assert( db->bConcurrent==0 );
     pDb->pSchema->schema_cookie = (int)pIn3->u.i;
     db->flags |= SQLITE_InternChanges;
   }else if( pOp->p2==BTREE_FILE_FORMAT ){
@@ -6115,11 +6115,11 @@ case OP_Expire: {
 */
 case OP_TableLock: {
   u8 isWriteLock = (u8)pOp->p3;
-#ifdef SQLITE_ENABLE_UNLOCKED
-  if( isWriteLock && db->bUnlocked && pOp->p2==1 ){
+#ifdef SQLITE_ENABLE_CONCURRENT
+  if( isWriteLock && db->bConcurrent && pOp->p2==1 ){
     rc = SQLITE_ERROR;
     sqlite3VdbeError(p, 
-        "cannot modify database schema within UNLOCKED transaction");
+        "cannot modify database schema within CONCURRENT transaction");
     rc = SQLITE_ERROR;
     break;
   }
index ea467e08a38dc97571d5659990f1570265044eee..4aef2ee08ed90913a552ffd4283ffe2aa2f2b7ff 100644 (file)
@@ -2025,8 +2025,8 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){
     }
   }
 
-#ifdef SQLITE_ENABLE_UNLOCKED
-  if( db->bUnlocked && (rc & 0xFF)==SQLITE_BUSY ){
+#ifdef SQLITE_ENABLE_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
     ** WRITER locks on all wal files and return early.  */
@@ -2443,7 +2443,7 @@ int sqlite3VdbeHalt(Vdbe *p){
           sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK);
           sqlite3CloseSavepoints(db);
           db->autoCommit = 1;
-          db->bUnlocked = 0;
+          db->bConcurrent = 0;
           p->nChange = 0;
         }
       }
@@ -2506,7 +2506,7 @@ int sqlite3VdbeHalt(Vdbe *p){
         sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK);
         sqlite3CloseSavepoints(db);
         db->autoCommit = 1;
-        db->bUnlocked = 0;
+        db->bConcurrent = 0;
         p->nChange = 0;
       }
     }
@@ -2528,7 +2528,7 @@ int sqlite3VdbeHalt(Vdbe *p){
         sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK);
         sqlite3CloseSavepoints(db);
         db->autoCommit = 1;
-        db->bUnlocked = 0;
+        db->bConcurrent = 0;
         p->nChange = 0;
       }
     }
index 9a2152424a3b3a0e7ac4f42359fa8e62adba6e30..4db42097501015d48c1fb3fec89ee4810aee979d 100644 (file)
--- a/src/wal.c
+++ b/src/wal.c
@@ -768,7 +768,7 @@ static const char *walLockName(int lockIdx){
 /*
 ** Set or release locks on the WAL.  Locks are either shared or exclusive.
 ** A lock cannot be moved directly between shared and exclusive - it must go
-** through the unlocked state first.
+** through the concurrent state first.
 **
 ** In locking_mode=EXCLUSIVE, all of these routines become no-ops.
 */
@@ -1068,7 +1068,7 @@ static int walIndexRecover(Wal *pWal){
   /* Obtain an exclusive lock on all byte in the locking range not already
   ** locked by the caller. The caller is guaranteed to have locked the
   ** WAL_WRITE_LOCK byte, and may have also locked the WAL_CKPT_LOCK byte.
-  ** If successful, the same bytes that are locked here are unlocked before
+  ** If successful, the same bytes that are locked here are concurrent before
   ** this function returns.
   */
   assert( pWal->ckptLock==1 || pWal->ckptLock==0 );
@@ -2608,14 +2608,14 @@ static int walUpgradeReadlock(Wal *pWal){
 }
 
 
-#ifdef SQLITE_ENABLE_UNLOCKED
+#ifdef SQLITE_ENABLE_CONCURRENT
 /* 
-** This function is only ever called when committing a "BEGIN UNLOCKED"
+** This function is only ever called when committing a "BEGIN CONCURRENT"
 ** transaction. It may be assumed that no frames have been written to
 ** the wal file. The second parameter is a pointer to the in-memory 
 ** representation of page 1 of the database (which may or may not be
 ** dirty). The third is a bitvec with a bit set for each page in the
-** database file that was read by the current unlocked transaction.
+** database file that was read by the current concurrent transaction.
 **
 ** This function performs three tasks:
 **
@@ -2626,7 +2626,7 @@ static int walUpgradeReadlock(Wal *pWal){
 **      it was opened, and
 **
 **   3) It ejects any non-dirty pages from the page-cache that have been
-**      written by another client since the UNLOCKED transaction was started
+**      written by another client since the CONCURRENT transaction was started
 **      (so as to avoid ending up with an inconsistent cache after the
 **      current transaction is committed).
 **
@@ -2657,7 +2657,7 @@ int sqlite3WalLockForCommit(Wal *pWal, PgHdr *pPage1, Bitvec *pAllRead){
     if( walIndexLoadHdr(pWal, &head) ){
       /* This branch is taken if the wal-index header is corrupted. This 
       ** occurs if some other writer has crashed while committing a 
-      ** transaction to this database since the current unlocked transaction
+      ** transaction to this database since the current concurrent transaction
       ** was opened.  */
       rc = SQLITE_BUSY_SNAPSHOT;
     }else if( memcmp(&pWal->hdr, (void*)&head, sizeof(WalIndexHdr))!=0 ){
@@ -2698,13 +2698,13 @@ int sqlite3WalLockForCommit(Wal *pWal, PgHdr *pPage1, Bitvec *pAllRead){
               }
             }else if( sqlite3BitvecTestNotNull(pAllRead, aPgno[i]) ){
               sqlite3_log(SQLITE_OK,
-                  "cannot commit UNLOCKED transaction (conflict at page %d)",
+                  "cannot commit CONCURRENT transaction (conflict at page %d)",
                   (int)aPgno[i]
               );
               rc = SQLITE_BUSY_SNAPSHOT;
             }else if( (pPg = sqlite3PagerLookup(pPager, aPgno[i])) ){
               /* Page aPgno[i], which is present in the pager cache, has been
-              ** modified since the current UNLOCKED transaction was started.
+              ** modified since the current CONCURRENT transaction was started.
               ** However it was not read by the current transaction, so is not
               ** a conflict. There are two possibilities: (a) the page was
               ** allocated at the of the file by the current transaction or 
@@ -2735,14 +2735,14 @@ int sqlite3WalLockForCommit(Wal *pWal, PgHdr *pPage1, Bitvec *pAllRead){
 }
 
 /*
-** This function is called as part of committing an UNLOCKED transaction.
+** 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
 ** wal-index-header stored in shared memory is not corrupt.
 **
 ** Before returning, this function upgrades the client so that it is 
 ** operating on the database snapshot currently at the head of the wal file
-** (even if the UNLOCKED transaction ran against an older snapshot).
+** (even if the CONCURRENT transaction ran against an older snapshot).
 **
 ** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
 */
@@ -2760,7 +2760,7 @@ int sqlite3WalUpgradeSnapshot(Wal *pWal){
   }
   return rc;
 }
-#endif   /* SQLITE_ENABLE_UNLOCKED */
+#endif   /* SQLITE_ENABLE_CONCURRENT */
 
 /*
 ** End a write transaction.  The commit has already been done.  This
similarity index 85%
rename from test/unlocked.test
rename to test/concurrent.test
index 0e22b97fa11481a756609ece6bf708912d8ece42..4f542ee79782478a9e73fc5cb1b8d51aa01e2eee 100644 (file)
@@ -13,9 +13,9 @@
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
 source $testdir/lock_common.tcl
-set ::testprefix unlocked
+set ::testprefix concurrent
 
-ifcapable !unlocked {
+ifcapable !concurrent {
   finish_test
   return
 }
@@ -26,7 +26,7 @@ do_execsql_test 1.0 {
 
 do_execsql_test 1.1 {
   CREATE TABLE t1(k INTEGER PRIMARY KEY, v);
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     INSERT INTO t1 VALUES(1, 'abcd');
   COMMIT;
 }
@@ -36,7 +36,7 @@ do_execsql_test 1.2 {
 } {1 abcd}
 
 do_execsql_test 1.3 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     INSERT INTO t1 VALUES(2, 'efgh');
   ROLLBACK;
 }
@@ -47,10 +47,10 @@ do_execsql_test 1.4 {
 
 
 #-------------------------------------------------------------------------
-# UNLOCKED transactions cannot do cache spills.
+# CONCURRENT transactions cannot do cache spills.
 #
 foreach {tn trans spill} {
-  1 {BEGIN UNLOCKED}  0
+  1 {BEGIN CONCURRENT}  0
   2 {BEGIN}           1
 } {
   do_test 1.5.$tn {
@@ -72,7 +72,7 @@ foreach {tn trans spill} {
 }
 
 #-------------------------------------------------------------------------
-# UNLOCKED transactions man not be committed while there are active
+# CONCURRENT transactions man not be committed while there are active
 # readers.
 do_execsql_test 1.6.setup {
   DROP TABLE t1;
@@ -82,7 +82,7 @@ do_execsql_test 1.6.setup {
   INSERT INTO t1 VALUES(5, 6);
 }
 foreach {tn trans commit_ok} {
-  1 {BEGIN UNLOCKED}  0
+  1 {BEGIN CONCURRENT}  0
   2 {BEGIN}           1
 } {
   do_test 1.6.$tn.1 {
@@ -105,7 +105,7 @@ foreach {tn trans commit_ok} {
 }
 
 #-------------------------------------------------------------------------
-# UNLOCKED transactions may not modify the db schema.
+# CONCURRENT transactions may not modify the db schema.
 #
 foreach {tn sql} {
   1 { CREATE TABLE xx(a, b) }
@@ -115,9 +115,9 @@ foreach {tn sql} {
   5 { CREATE TEMP TABLE xx(a, b) }
 } {
   do_catchsql_test 1.7.$tn.1 "
-    BEGIN UNLOCKED;
+    BEGIN CONCURRENT;
     $sql
-  " {1 {cannot modify database schema within UNLOCKED transaction}}
+  " {1 {cannot modify database schema within CONCURRENT transaction}}
 
   do_execsql_test 1.7.$tn.2 {
     SELECT sql FROM sqlite_master;
@@ -128,8 +128,8 @@ foreach {tn sql} {
 }
 
 #-------------------------------------------------------------------------
-# If an auto-vacuum database is written within an UNLOCKED transaction, it
-# is handled in the same way as for a non-UNLOCKED transaction.
+# If an auto-vacuum database is written within an CONCURRENT transaction, it
+# is handled in the same way as for a non-CONCURRENT transaction.
 #
 reset_db
 do_execsql_test 1.8.1 {
@@ -140,20 +140,20 @@ do_execsql_test 1.8.1 {
 } {wal}
 
 do_execsql_test 1.8.2 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     SELECT * FROM t1;
   COMMIT;
 } {x y}
 
 do_catchsql_test 1.8.3 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     INSERT INTO t1 VALUES('a', 'b');
 } {0 {}}
 
 do_test 1.8.4 {
   sqlite3 db2 test.db
   catchsql {
-    BEGIN UNLOCKED;
+    BEGIN CONCURRENT;
       INSERT INTO t1 VALUES('c', 'd');
   } db2
 } {1 {database is locked}}
@@ -166,10 +166,10 @@ do_test 1.8.5 {
 do_multiclient_test tn {
 
   #-----------------------------------------------------------------------
-  # 1. Start an UNLOCKED transaction using [db1].
+  # 1. Start an CONCURRENT transaction using [db1].
   #
   # 2. Start and then rollback a regular transaction using [db2]. This 
-  #    can be done as the ongoing [db1] transaction is UNLOCKED.
+  #    can be done as the ongoing [db1] transaction is CONCURRENT.
   #
   # 3. The [db1] transaction can now be committed, as [db2] has relinquished
   #    the write lock.
@@ -181,7 +181,7 @@ do_multiclient_test tn {
       INSERT INTO t1 VALUES(1, 'one');
     }
     sql1 { 
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(2, 'two');
     }
     code1 { sqlite3_get_autocommit db }
@@ -201,7 +201,7 @@ do_multiclient_test tn {
   } {1 one 2 two}
   
   #-----------------------------------------------------------------------
-  # 1. Start an UNLOCKED transaction using [db1].
+  # 1. Start an CONCURRENT transaction using [db1].
   #
   # 2. Commit a transaction using [db2].
   #
@@ -210,7 +210,7 @@ do_multiclient_test tn {
   #
   do_test 2.$tn.2.1 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(-1, 'hello world');
     }
   } {}
@@ -238,7 +238,7 @@ do_multiclient_test tn {
   } {-1 {hello world} 1 one 2 two}
   
   #-----------------------------------------------------------------------
-  # 1. Start an UNLOCKED transaction using [db1].
+  # 1. Start an CONCURRENT transaction using [db1].
   #
   # 2. Open a transaction using [db2].
   #
@@ -250,7 +250,7 @@ do_multiclient_test tn {
   #
   do_test 2.$tn.3.1 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(4, 'four');
     }
   } {}
@@ -293,12 +293,12 @@ do_multiclient_test tn {
   } {}
   do_test 2.$tn.4.2 {
     sql2 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t2 VALUES('i', 'n');
     }
 
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(5, 'five');
       COMMIT;
     }
@@ -319,16 +319,16 @@ do_multiclient_test tn {
   #-----------------------------------------------------------------------
   # The "schema cookie" issue.
   #
-  # 1. Begin and UNLOCKED write to "t1" using [db]
+  # 1. Begin and CONCURRENT write to "t1" using [db]
   #
   # 2. Create an index on t1 using [db2].
   #
-  # 3. Attempt to commit the UNLOCKED write. This is an SQLITE_BUSY_SNAPSHOT,
+  # 3. Attempt to commit the CONCURRENT write. This is an SQLITE_BUSY_SNAPSHOT,
   #    even though there is no page collision.
   #
   do_test 2.$tn.5.1 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(6, 'six');
     }
   } {}
@@ -348,15 +348,15 @@ do_multiclient_test tn {
 
   #-----------------------------------------------------------------------
   #
-  # 1. Begin an UNLOCKED write to "t1" using [db]
+  # 1. Begin an CONCURRENT write to "t1" using [db]
   #
   # 2. Lots of inserts into t2. Enough to grow the db file and modify page 1.
   #
-  # 3. Check that the UNLOCKED transaction can not be committed.
+  # 3. Check that the CONCURRENT transaction can not be committed.
   #
   do_test 2.$tn.6.1 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(6, 'six');
     }
   } {}
@@ -384,17 +384,17 @@ do_multiclient_test tn {
 
   #-----------------------------------------------------------------------
   # 
-  # 1. Begin an big UNLOCKED write to "t1" using [db] - large enough to
+  # 1. Begin an big CONCURRENT write to "t1" using [db] - large enough to
   #    grow the db file.
   #
   # 2. Lots of inserts into t2. Also enough to grow the db file.
   #
-  # 3. Check that the UNLOCKED transaction cannot be committed (due to a clash
+  # 3. Check that the CONCURRENT transaction cannot be committed (due to a clash
   #    on page 1 - the db size field).
   #
   do_test 2.$tn.7.1 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         WITH src(a,b) AS (
           VALUES(10000,10000) UNION ALL SELECT a+1,b+1 FROM src WHERE a<20000
         ) INSERT INTO t1 SELECT * FROM src;
@@ -427,20 +427,20 @@ do_execsql_test 3.0 {
   PRAGMA user_version = 10;
 } {wal}
 do_execsql_test 3.1 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     INSERT INTO t1 VALUES('c', 'd');
     SELECT * FROM t1;
 } {a b c d}
 do_catchsql_test 3.2 {
   PRAGMA user_version = 11;
-} {1 {cannot modify user_version within UNLOCKED transaction}}
+} {1 {cannot modify user_version within CONCURRENT transaction}}
 do_execsql_test 3.3 {
   PRAGMA user_version;
   SELECT * FROM t1;
 } {10 a b c d}
 do_catchsql_test 3.4 {
   PRAGMA application_id = 11;
-} {1 {cannot modify application_id within UNLOCKED transaction}}
+} {1 {cannot modify application_id within CONCURRENT transaction}}
 do_execsql_test 3.5 {
   COMMIT;
   PRAGMA user_version;
similarity index 87%
rename from test/unlocked2.test
rename to test/concurrent2.test
index f28d62e0a141c2ad9fa48faf7969c60949d8e8c3..d058733e485a7a99f068f52eaa5bf20fa089aa23 100644 (file)
@@ -13,9 +13,9 @@
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
 source $testdir/lock_common.tcl
-set ::testprefix unlocked2
+set ::testprefix concurrent2
 
-ifcapable !unlocked {
+ifcapable !concurrent {
   finish_test
   return
 }
@@ -31,11 +31,11 @@ do_multiclient_test tn {
   } {wal}
   do_test 1.$tn.5 { sql3 { PRAGMA integrity_check } } {ok}
 
-  # Test that an UNLOCKED transaction that allocates/frees no pages does
+  # Test that an CONCURRENT transaction that allocates/frees no pages does
   # not conflict with a transaction that does allocate pages.
   do_test 1.$tn.2  {
     sql1 { 
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(4);
     }
     sql2 {
@@ -47,11 +47,11 @@ do_multiclient_test tn {
   } {}
   do_test 1.$tn.5 { sql3 { PRAGMA integrity_check } } {ok}
   
-  # But that an UNLOCKED transaction does conflict with a transaction
+  # But that an CONCURRENT transaction does conflict with a transaction
   # that modifies the db schema.
   do_test 1.$tn.3  {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(5);
     }
     sql2 {
@@ -61,12 +61,12 @@ do_multiclient_test tn {
   } {1 {database is locked}}
   do_test 1.$tn.5 { sql3 { PRAGMA integrity_check } } {ok}
   
-  # Test that an UNLOCKED transaction that allocates at least one page 
+  # Test that an CONCURRENT transaction that allocates at least one page 
   # does not conflict with a transaction that allocates no pages.
   do_test 1.$tn.4  {
     sql1 { 
       ROLLBACK;
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(randomblob(1500));
     }
     sql2 {
@@ -91,7 +91,7 @@ do_multiclient_test tn {
 
   do_test 2.$tn.2  {
     sql1 { 
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(randomblob(1500));
     }
     sql2 {
@@ -104,7 +104,7 @@ do_multiclient_test tn {
 
   do_test 2.$tn.4  {
     sql1 { 
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         DELETE FROM t1;
     }
     sql2 {
@@ -124,7 +124,7 @@ do_multiclient_test tn {
     }
 
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         DELETE FROM t1 WHERE rowid=2;
     }
 
@@ -139,15 +139,15 @@ do_multiclient_test tn {
 }
 
 #-------------------------------------------------------------------------
-# When an UNLOCKED transaction is opened on a database, the nFree and 
+# When an CONCURRENT transaction is opened on a database, the nFree and 
 # iTrunk header fields of the cached version of page 1 are both set 
-# to 0. This allows an UNLOCKED transaction to use its own private 
+# to 0. This allows an CONCURRENT transaction to use its own private 
 # free-page-list, which is merged with the main database free-list when
 # the transaction is committed.
 #
 # The following tests check that nFree/iTrunk are correctly restored if
-# an UNLOCKED transaction is rolled back, and that savepoint rollbacks
-# that occur within UNLOCKED transactions do not incorrectly restore
+# an CONCURRENT transaction is rolled back, and that savepoint rollbacks
+# that occur within CONCURRENT transactions do not incorrectly restore
 # these fields to their on-disk values.
 #
 reset_db
@@ -159,7 +159,7 @@ do_execsql_test 3.0 {
 } {wal}
 
 do_execsql_test 3.1 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     INSERT INTO t1 VALUES(1, 2);
   ROLLBACK;
 }
@@ -168,7 +168,7 @@ do_execsql_test 3.2 { PRAGMA integrity_check } {ok}
 do_execsql_test 3.3 { PRAGMA freelist_count } {2}
 
 do_execsql_test 3.4.1 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     PRAGMA freelist_count;
 } {2}
 do_execsql_test 3.4.2 {
@@ -184,7 +184,7 @@ do_execsql_test 3.4.5 { COMMIT; PRAGMA freelist_count } {2}
 do_execsql_test 3.4.6 { PRAGMA integrity_check } {ok}
 
 do_execsql_test 3.5.1 {
-  BEGIN UNLOCKED;
+  BEGIN CONCURRENT;
     UPDATE t1 SET x=randomblob(10) WHERE y=555;
     PRAGMA freelist_count;
 } {0}
@@ -195,7 +195,7 @@ do_execsql_test 3.5.2 {
 do_execsql_test 3.5.3 { PRAGMA integrity_check } {ok}
 
 #-------------------------------------------------------------------------
-# Test that nothing goes wrong if an UNLOCKED transaction allocates a
+# Test that nothing goes wrong if an CONCURRENT transaction allocates a
 # page at the end of the file, frees it within the same transaction, and
 # then has to move the same page to avoid a conflict on COMMIT.
 #
@@ -210,7 +210,7 @@ do_multiclient_test tn {
 
   do_test 4.$tn.2 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(randomblob(1500));
         INSERT INTO t1 VALUES(randomblob(1500));
         DELETE FROM t1 WHERE rowid = 1;
@@ -243,7 +243,7 @@ do_multiclient_test tn {
 
   do_test 5.$tn.2 {
     sql1 {
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t2 VALUES(randomblob(1500));
         PRAGMA page_count;
     }
@@ -275,7 +275,7 @@ do_multiclient_test tn {
 
   do_test 6.$tn.2 {
     sql1 { 
-      BEGIN UNLOCKED;
+      BEGIN CONCURRENT;
         INSERT INTO t1 VALUES(randomblob(1500));
         INSERT INTO t1 VALUES(randomblob(1500));
     }
similarity index 93%
rename from test/unlocked3.test
rename to test/concurrent3.test
index 36299db38106bbf93fad9d8507571d156e33cb81..25e5d7c6c97ca41cc2b1e189288831725db643c4 100644 (file)
@@ -9,17 +9,17 @@
 #
 #***********************************************************************
 #
-# Tests for transactions started with BEGIN UNLOCKED. The tests in this
+# Tests for transactions started with BEGIN CONCURRENT. The tests in this
 # file focus on testing that deferred page allocation works properly.
 #
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
 source $testdir/lock_common.tcl
-set ::testprefix unlocked3
+set ::testprefix concurrent3
 
 if {$AUTOVACUUM} { finish_test ; return }
-ifcapable !unlocked {
+ifcapable !concurrent {
   finish_test
   return
 }
@@ -110,7 +110,7 @@ foreach {tn oplist} {
   foreach db $DBLIST { sqlite3 $db test.db }
 
   do_test 1.$tn {
-    foreach db $DBLIST { $db eval "BEGIN UNLOCKED" } 
+    foreach db $DBLIST { $db eval "BEGIN CONCURRENT" } 
 
     foreach op $oplist {
       set iTbl [string range $op 0 0]
index d1810cbeb99f2be7ac8abcd921f8ce17f211f94f..50585b1d099325e0df04d62f154f9a4249eea790 100644 (file)
@@ -171,6 +171,7 @@ static Keyword aKeywordTable[] = {
   { "COLLATE",          "TK_COLLATE",      ALWAYS                 },
   { "COLUMN",           "TK_COLUMNKW",     ALTER                  },
   { "COMMIT",           "TK_COMMIT",       ALWAYS                 },
+  { "CONCURRENT",       "TK_CONCURRENT",   ALWAYS                 },
   { "CONFLICT",         "TK_CONFLICT",     CONFLICT               },
   { "CONSTRAINT",       "TK_CONSTRAINT",   ALWAYS                 },
   { "CREATE",           "TK_CREATE",       ALWAYS                 },
@@ -262,7 +263,6 @@ static Keyword aKeywordTable[] = {
   { "TRIGGER",          "TK_TRIGGER",      TRIGGER                },
   { "UNION",            "TK_UNION",        COMPOUND               },
   { "UNIQUE",           "TK_UNIQUE",       ALWAYS                 },
-  { "UNLOCKED",         "TK_UNLOCKED",     ALWAYS                 },
   { "UPDATE",           "TK_UPDATE",       ALWAYS                 },
   { "USING",            "TK_USING",        ALWAYS                 },
   { "VACUUM",           "TK_VACUUM",       VACUUM                 },