]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Avoid unnecessary work inside of verifyDbFile() in the unix VFS. unix-vfs-optimization
authordrh <drh@noemail.net>
Tue, 8 Dec 2015 14:37:16 +0000 (14:37 +0000)
committerdrh <drh@noemail.net>
Tue, 8 Dec 2015 14:37:16 +0000 (14:37 +0000)
FossilOrigin-Name: f3c0579e931799088e9a83757e25bae229120697

manifest
manifest.uuid
src/os_unix.c

index d584f281f3cc1e672887a1a9c7e5aaa24500281f..11df61697b023b5016114ee4139953339256c039 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sa\stest\scase\sof\sthe\sform\s"WHERE\sa<2\sOR\sa<3"\susing\sPRAGMA\scount_changes.\nThis\stest\scase\swas\sfailing\sbefore\sthe\s3.9.0\srelease.
-D 2015-12-08T04:18:33.696
+C Avoid\sunnecessary\swork\sinside\sof\sverifyDbFile()\sin\sthe\sunix\sVFS.
+D 2015-12-08T14:37:16.738
 F Makefile.in 28bcd6149e050dff35d4dcfd97e890cd387a499d
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc e8fdca1cb89a1b58b5f4d3a130ea9a3d28cb314d
@@ -323,7 +323,7 @@ F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
 F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
 F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e
 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
-F src/os_unix.c 0ca6d8710366fbb01a275160f018334cd347cbda
+F src/os_unix.c 2f3bb1da50782128edf31fb17d22dc46f14c6eae
 F src/os_win.c 386fba30419e8458b13209781c2af5590eab2811
 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
 F src/pager.c f92aacd5216d8815136c9e0190041783c602641a
@@ -1408,7 +1408,10 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 07e5199c6f868cc02a0b708865254056c4f3daf3
-R 17b34bcad46ec764b462c91813dd5909
+P 177862c1d50ba899d890fbc35f35e7423bc6aed5
+R cc3c3a45cf6a02d31e382067a458ce71
+T *branch * unix-vfs-optimization
+T *sym-unix-vfs-optimization *
+T -sym-trunk *
 U drh
-Z 86e126efc794a5aaf900005c30a5cf69
+Z fcbe6020f6a9bf3f613adea5032fb70c
index d39829dc7591561ffd23f4fbeb6fb037c4b7828f..12ed6b4bd9e45ec4b47005e10dd66e437cc1f56d 100644 (file)
@@ -1 +1 @@
-177862c1d50ba899d890fbc35f35e7423bc6aed5
\ No newline at end of file
+f3c0579e931799088e9a83757e25bae229120697
\ No newline at end of file
index 791ba5d8d966f7c42c124f31767c5d0a4f6caeed..25f769fa50c7ed79c10aa20d8e1ac4dd01c76af4 100644 (file)
@@ -1315,6 +1315,10 @@ static int fileHasMoved(unixFile *pFile){
 static void verifyDbFile(unixFile *pFile){
   struct stat buf;
   int rc;
+
+  /* These verifications occurs for the main database only */
+  if( pFile->ctrlFlags & UNIXFILE_NOLOCK ) return;
+
   rc = osFstat(pFile->h, &buf);
   if( rc!=0 ){
     sqlite3_log(SQLITE_WARNING, "cannot fstat db file %s", pFile->zPath);
@@ -5761,9 +5765,6 @@ static int unixOpen(
     p->openFlags = openFlags;
   }
 #endif
-
-  noLock = eType!=SQLITE_OPEN_MAIN_DB;
-
   
 #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
   if( fstatfs(fd, &fsInfo) == -1 ){
@@ -5782,6 +5783,7 @@ static int unixOpen(
   /* Set up appropriate ctrlFlags */
   if( isDelete )                ctrlFlags |= UNIXFILE_DELETE;
   if( isReadonly )              ctrlFlags |= UNIXFILE_RDONLY;
+  noLock = eType!=SQLITE_OPEN_MAIN_DB;
   if( noLock )                  ctrlFlags |= UNIXFILE_NOLOCK;
   if( syncDir )                 ctrlFlags |= UNIXFILE_DIRSYNC;
   if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI;