]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the win32-none VFS which omits rollback-journal locking.
authordrh <drh@noemail.net>
Tue, 22 Apr 2014 19:30:00 +0000 (19:30 +0000)
committerdrh <drh@noemail.net>
Tue, 22 Apr 2014 19:30:00 +0000 (19:30 +0000)
FossilOrigin-Name: 03e3c5a8b17a219a49bfbe79b7debd27ace8ad85

manifest
manifest.uuid
src/os_win.c

index 7f4e9189fddf062f6a3aad64aa6a514bfd7ef0e3..9f24411d5f4032f74437219212bb9fbc354fd9db 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Comment\stweaks\son\sthe\stest\scase\sfor\sthe\s[b75a9ca6b0]\sbug\sfix.
-D 2014-04-21T13:36:54.639
+C Add\sthe\swin32-none\sVFS\swhich\somits\srollback-journal\slocking.
+D 2014-04-22T19:30:00.797
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -204,7 +204,7 @@ F src/os.c 1b147e4cf7cc39e618115c14a086aed44bc91ace
 F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
 F src/os_unix.c ae4b5240af4619d711301d7992396e182585269f
-F src/os_win.c e71678ac927d0a0fb11d993db20a9748eabf808e
+F src/os_win.c a49ee67a07d7aff98bd9793e7ac8c68ee12712b4
 F src/pager.c ab62a24218d87dda1be641f6c5ad291bff78fd94
 F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428
 F src/parse.y 22d6a074e5f5a7258947a1dc55a9bf946b765dd0
@@ -1161,7 +1161,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P de9a490f594183f337a2ec9e0f87792eac83548b
-R ce888b84132e0cad3bcca115a32951d3
+P 65d2544af9adc1e2f1d193e57f8be0422fb0d5eb
+R a9779ff2bb2c9843026c8b0117f1fe75
+T *branch * win32-none
+T *sym-win32-none *
+T -sym-trunk *
 U drh
-Z cf9f241149456ab1fa24984e95a412d2
+Z d17256f50e94b0475de531ab714c2ce7
index a2761a597be17902e9abe6d6358bda6ee495daa3..0a5654bde972e2d60f7e0f398a7e1c10899081eb 100644 (file)
@@ -1 +1 @@
-65d2544af9adc1e2f1d193e57f8be0422fb0d5eb
\ No newline at end of file
+03e3c5a8b17a219a49bfbe79b7debd27ace8ad85
\ No newline at end of file
index 287dad3b5714b03d4c97fee4a43c3ba72cfa4115..6b22fab20a91684a775d694bfc2093cb96e46e25 100644 (file)
@@ -275,6 +275,7 @@ struct winFile {
 #define WINFILE_RDONLY          0x02   /* Connection is read only */
 #define WINFILE_PERSIST_WAL     0x04   /* Persistent WAL mode */
 #define WINFILE_PSOW            0x10   /* SQLITE_IOCAP_POWERSAFE_OVERWRITE */
+#define WINFILE_NOLOCK          0x20   /* Never do any real locking */
 
 /*
  * The size of the buffer used by sqlite3_win32_write_debug().
@@ -2859,6 +2860,9 @@ static int winLock(sqlite3_file *id, int locktype){
   assert( id!=0 );
   OSTRACE(("LOCK file=%p, oldLock=%d(%d), newLock=%d\n",
            pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
+  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
+    return SQLITE_OK;
+  }
 
   /* If there is already a lock of this type or more restrictive on the
   ** OsFile, do nothing. Don't use the end_lock: exit path, as
@@ -2986,7 +2990,9 @@ static int winCheckReservedLock(sqlite3_file *id, int *pResOut){
   OSTRACE(("TEST-WR-LOCK file=%p, pResOut=%p\n", pFile->h, pResOut));
 
   assert( id!=0 );
-  if( pFile->locktype>=RESERVED_LOCK ){
+  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
+    rc = 0;
+  }else if( pFile->locktype>=RESERVED_LOCK ){
     rc = 1;
     OSTRACE(("TEST-WR-LOCK file=%p, rc=%d (local)\n", pFile->h, rc));
   }else{
@@ -3022,6 +3028,9 @@ static int winUnlock(sqlite3_file *id, int locktype){
   assert( locktype<=SHARED_LOCK );
   OSTRACE(("UNLOCK file=%p, oldLock=%d(%d), newLock=%d\n",
            pFile->h, pFile->locktype, pFile->sharedLockByte, locktype));
+  if( pFile->ctrlFlags & WINFILE_NOLOCK ){
+    return SQLITE_OK;
+  }
   type = pFile->locktype;
   if( type>=EXCLUSIVE_LOCK ){
     winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0);
@@ -4692,6 +4701,9 @@ static int winOpen(
   if( sqlite3_uri_boolean(zName, "psow", SQLITE_POWERSAFE_OVERWRITE) ){
     pFile->ctrlFlags |= WINFILE_PSOW;
   }
+  if( strcmp(pVfs->zName,"win32-none")==0 ){
+    pFile->ctrlFlags |= WINFILE_NOLOCK;
+  }
   pFile->lastErrno = NO_ERROR;
   pFile->zPath = zName;
 #if SQLITE_MAX_MMAP_SIZE>0
@@ -5416,6 +5428,30 @@ int sqlite3_os_init(void){
     winNextSystemCall,   /* xNextSystemCall */
   };
 #endif
+  static sqlite3_vfs winNoneVfs = {
+    3,                   /* iVersion */
+    sizeof(winFile),     /* szOsFile */
+    SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */
+    0,                   /* pNext */
+    "win32-none",        /* zName */
+    0,                   /* pAppData */
+    winOpen,             /* xOpen */
+    winDelete,           /* xDelete */
+    winAccess,           /* xAccess */
+    winFullPathname,     /* xFullPathname */
+    winDlOpen,           /* xDlOpen */
+    winDlError,          /* xDlError */
+    winDlSym,            /* xDlSym */
+    winDlClose,          /* xDlClose */
+    winRandomness,       /* xRandomness */
+    winSleep,            /* xSleep */
+    winCurrentTime,      /* xCurrentTime */
+    winGetLastError,     /* xGetLastError */
+    winCurrentTimeInt64, /* xCurrentTimeInt64 */
+    winSetSystemCall,    /* xSetSystemCall */
+    winGetSystemCall,    /* xGetSystemCall */
+    winNextSystemCall,   /* xNextSystemCall */
+  };
 
   /* Double-check that the aSyscall[] array has been constructed
   ** correctly.  See ticket [bb3a86e890c8e96ab] */
@@ -5432,6 +5468,7 @@ int sqlite3_os_init(void){
   assert( winSysInfo.dwPageSize>0 );
 
   sqlite3_vfs_register(&winVfs, 1);
+  sqlite3_vfs_register(&winNoneVfs, 0);
 
 #if defined(SQLITE_WIN32_HAS_WIDE)
   sqlite3_vfs_register(&winLongPathVfs, 0);