]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Cherry-pick the SQLITE_FCNTL_SIZE_HINT patch (check-in [2b7e3b4a30d6a7c4a8]
authordrh <drh@noemail.net>
Wed, 19 May 2010 22:09:19 +0000 (22:09 +0000)
committerdrh <drh@noemail.net>
Wed, 19 May 2010 22:09:19 +0000 (22:09 +0000)
and bump the version number to 3.6.23.2.

FossilOrigin-Name: 776679af588625f13307369770979bccae7cf03a

VERSION
manifest
manifest.uuid
src/os_unix.c
src/os_win.c
src/pager.c
src/sqlite.h.in

diff --git a/VERSION b/VERSION
index cc690cc4364a8e324d6fe9403ad80f5db3317977..ea05a754963afe3c6949e0df3abcc55414dd542b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.6.23.1
+3.6.23.2
index c6e5e0ffe072ce16a2c1b577438c51cb26ae0370..09cbf369f7639f0af363d1985cb12d09d64cfa88 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,14 +1,14 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Disable\sthe\scorruptE\stest\swhich\sSQLITE_OVERSIZE_CELL_CHECK\sis\senabled.\nThis\sis\sa\scherrypick\smerge\sfrom\scheck-in\s[1dc4f9fe9b83467ba].
-D 2010-05-19T20:30:16
+C Cherry-pick\sthe\sSQLITE_FCNTL_SIZE_HINT\spatch\s(check-in\s[2b7e3b4a30d6a7c4a8]\nand\sbump\sthe\sversion\snumber\sto\s3.6.23.2.
+D 2010-05-19T22:09:19
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 4f2f967b7e58a35bb74fb7ec8ae90e0f4ca7868b
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
 F Makefile.vxworks ab005d301296c40e021ccd0133ce49ca811e319f
 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6
-F VERSION 09d2dfb6a4a47d07b3b2091e349eedef78fb0f77
+F VERSION e074e6c926531bc0ccf713d48465eb16807d7193
 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
 F addopcodes.awk 17dc593f791f874d2c23a0f9360850ded0286531
 F art/2005osaward.gif 0d1851b2a7c1c9d0ccce545f3e14bca42d7fd248
@@ -153,9 +153,9 @@ F src/os.c 8bc63cf91e9802e2b807198e54e50227fa889306
 F src/os.h 534b082c3cb349ad05fa6fa0b06087e022af282c
 F src/os_common.h 240c88b163b02c21a9f21f87d49678a0aa21ff30
 F src/os_os2.c 75a8c7b9a00a2cf1a65f9fa4afbc27d46634bb2f
-F src/os_unix.c 148d2f625db3727250c0b880481ae7630b6d0eb0
-F src/os_win.c 1c7453c2df4dab26d90ff6f91272aea18bcf7053
-F src/pager.c 1915e3ec1a2157d0c29086b7fc0c936a2d97029e
+F src/os_unix.c fdeb37c703243141470396acf32331674b905e55
+F src/os_win.c bc65553f911439a6b1aa3cf22f34e5ea1c4aa394
+F src/pager.c e39ac887694a6644135f5e4151fe293b5397dd64
 F src/pager.h 1b32faf2e578ac3e7bcf9c9d11217128261c5c54
 F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e
 F src/pcache.c 4956b41d6ba913f7a8a56fbf32be78caed0e45c2
@@ -169,7 +169,7 @@ F src/resolve.c a1648d98e869937b29f4f697461fe4d60f220a7b
 F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
 F src/select.c 4113ef360430ed4e7533690ef46d06c20204adce
 F src/shell.c c40427c7245535a04a9cb4a417b6cc05c022e6a4
-F src/sqlite.h.in 08a2d9a278ff0dfd65055a7ec9c599f7ae1a3c18
+F src/sqlite.h.in f9a9be1bce911669a259f7c747bf05635cb360b5
 F src/sqlite3ext.h 69dfb8116af51b84a029cddb3b35062354270c89
 F src/sqliteInt.h 6873f7f4c24fcdceece8777f2a1cbec049df77a0
 F src/sqliteLimit.h 3afab2291762b5d09ae20c18feb8e9fa935a60a6
@@ -795,14 +795,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P b51fcac9fb4207810ee8d33ead47886e9c46d224
-R 5026f362b493c0d77060cf3649122050
+P a40d080ca3c5f152f3296caf48f20728f61317de
+R 6b321985aaecd4ff831144c4a95fd584
 U drh
-Z b66b4e4c871064b8805e5065bde070bc
+Z c0f8d3e720ac9f1021b4b9695ecbd8fd
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFL9EpboxKgR168RlERApFWAJ9PwVd2vtYYmrUVxPOHb8rjJua9iQCeKmI2
-LDgKLnQS+QE03MScalpbIxY=
-=ekzi
+iD8DBQFL9GGSoxKgR168RlERAnsLAJ9mAxq1HjJvHt5vClDz1V5oM9GOTwCgiKms
+ckp+G3lPReQ5n8ebpgNyR7c=
+=B53W
 -----END PGP SIGNATURE-----
index 15bdf941c3dea155e08f394d8a68527c5609f097..f2572112b7deff507d123cfe2fbe0cedfe17aa70 100644 (file)
@@ -1 +1 @@
-a40d080ca3c5f152f3296caf48f20728f61317de
\ No newline at end of file
+776679af588625f13307369770979bccae7cf03a
\ No newline at end of file
index 769e75df39ec62c85a4b0f5663e960bea4b1951c..8c35d285f380e96034eace271f7bbcb37fa3fa49 100644 (file)
@@ -3349,6 +3349,12 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
       *(int*)pArg = ((unixFile*)id)->lastErrno;
       return SQLITE_OK;
     }
+    case SQLITE_FCNTL_SIZE_HINT: {
+      sqlite3_int64 szFile = *(sqlite3_int64*)pArg;
+      unixFile *pFile = (unixFile*)id;
+      ftruncate(pFile->h, szFile);
+      return SQLITE_OK;
+    }
 #ifndef NDEBUG
     /* The pager calls this method to signal that it has done
     ** a rollback and that the database is therefore unchanged and
index 4721eadff85bb0bdb55a71ddd874208c69da5d00..c3ea1b27548bb470e25ba23e32541e3393d90c28 100644 (file)
@@ -1112,6 +1112,11 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){
       *(int*)pArg = (int)((winFile*)id)->lastErrno;
       return SQLITE_OK;
     }
+    case SQLITE_FCNTL_SIZE_HINT: {
+      sqlite3_int64 sz = *(sqlite3_int64*)pArg;
+      winTruncate(id, sz);
+      return SQLITE_OK;
+    }
   }
   return SQLITE_ERROR;
 }
index 180b3c794707c40a405e0f94cfe7cc9c9a82801b..61e0e98f38a68d4cef03bfa4457dbc00b9eb652f 100644 (file)
@@ -2869,6 +2869,17 @@ static int pager_write_pagelist(PgHdr *pList){
     rc = pagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
   }
 
+  /* Before the first write, give the VFS a hint of what the final
+  ** file size will be.
+  */
+  if( rc==SQLITE_OK
+   && pPager->dbSize>(pPager->dbFileSize+1)
+   && isOpen(pPager->fd)
+  ){
+    sqlite3_int64 szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
+    sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
+  }
+
   while( rc==SQLITE_OK && pList ){
     Pgno pgno = pList->pgno;
 
@@ -4660,7 +4671,7 @@ int sqlite3PagerCommitPhaseOne(
           sqlite3PagerUnref(pPage);
           if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
         }
-      } 
+      }
       pPager->dbSize = dbSize;
     }
 #endif
index f831496ab022ec3cca6a755f41de659fdfd6d53c..d0827abd5a84c52d2cf8dd44b355f43f9a3f4a1f 100644 (file)
@@ -670,11 +670,19 @@ struct sqlite3_io_methods {
 ** into an integer that the pArg argument points to. This capability
 ** is used during testing and only needs to be supported when SQLITE_TEST
 ** is defined.
+**
+** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
+** layer a hint of how large the database file will grow to be during the
+** current transaction.  This hint is not guaranteed to be accurate but it
+** is often close.  The underlying VFS might choose to preallocate database
+** file space based on this hint in order to help writes to the database
+** file run faster.
 */
 #define SQLITE_FCNTL_LOCKSTATE        1
 #define SQLITE_GET_LOCKPROXYFILE      2
 #define SQLITE_SET_LOCKPROXYFILE      3
 #define SQLITE_LAST_ERRNO             4
+#define SQLITE_FCNTL_SIZE_HINT        5
 
 /*
 ** CAPI3REF: Mutex Handle