]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Change the xShmOpen() method of the VFS to take the database file name as
authordrh <drh@noemail.net>
Fri, 7 May 2010 20:02:23 +0000 (20:02 +0000)
committerdrh <drh@noemail.net>
Fri, 7 May 2010 20:02:23 +0000 (20:02 +0000)
its argument, not the WAL file name.  Also fix some unrelated compiler
warnings.

FossilOrigin-Name: a65c2939267ef6acec4e355a207f98f217e263d6

manifest
manifest.uuid
src/mutex_noop.c
src/os_unix.c
src/wal.c

index 28ef17810eeff674a54c7916875fb03ffd406bdd..7af380648e0909339c7534ae1a08bc6ce2ce2dcc 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Additional\stweaks\sto\sAPI\sdocumentation.\s\sNo\sfunctional\scode\schanges.
-D 2010-05-07T18:23:25
+C Change\sthe\sxShmOpen()\smethod\sof\sthe\sVFS\sto\stake\sthe\sdatabase\sfile\sname\sas\nits\sargument,\snot\sthe\sWAL\sfile\sname.\s\sAlso\sfix\ssome\sunrelated\scompiler\nwarnings.
+D 2010-05-07T20:02:24
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -146,7 +146,7 @@ F src/mem5.c eb7a5cb98915dd7a086fa415ce3a5a0f20d0acff
 F src/memjournal.c f3be374af30588de297dcf678925b2a4758e4135
 F src/mutex.c e2358d8f9a9021ab0bba4d511bb701e471e6e5f6
 F src/mutex.h 6fde601e55fa6c3fae768783c439797ab84c87c6
-F src/mutex_noop.c e4942ed01b10f64ebe30cae4d5ad999c534c6c74
+F src/mutex_noop.c 10ae943d26ba86ea92319f72adbb501a89c563e0
 F src/mutex_os2.c 20477db50cf3817c2f1cd3eb61e5c177e50231db
 F src/mutex_unix.c 04a25238abce7e3d06b358dcf706e26624270809
 F src/mutex_w32.c 4cc201c1bfd11d1562810554ff5500e735559d7e
@@ -155,7 +155,7 @@ F src/os.c aec6922553585a25d5655666defc125a7e217674
 F src/os.h b389844e5469a2918e8a45fe6ae52b4c28dfb2b2
 F src/os_common.h 0d6ee583b6ee3185eb9d951f890c6dd03021a08d
 F src/os_os2.c 8ad77a418630d7dee91d1bb04f79c2096301d3a0
-F src/os_unix.c 00403219ceac733ade0b0bb7373146f8e1c18ac1
+F src/os_unix.c 164d85df39df72fb1e9611cbf723f9287e622d98
 F src/os_win.c a8fc01d8483be472e495793c01064fd87e56a5c1
 F src/pager.c a47af9c2c9ca425bd68642d61764266331a3323f
 F src/pager.h 934b598583a9d936bb13c37d62a2fe68ac48781c
@@ -227,7 +227,7 @@ F src/vdbeblob.c 5327132a42a91e8b7acfb60b9d2c3b1c5c863e0e
 F src/vdbemem.c 2a82f455f6ca6f78b59fb312f96054c04ae0ead1
 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2
 F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda
-F src/wal.c 53b7461586bd883313e8bed46830557c720899c8
+F src/wal.c 6704aa53295073e590f3d802acec9722df671cd8
 F src/wal.h b4c42014b5fa3b4e6244ac8c65de7ff67adeb27c
 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
 F src/where.c 75fee9e255b62f773fcadd1d1f25b6f63ac7a356
@@ -816,14 +816,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 681ba20cf077e9a0fccd51ed50101ad0f2c67eb3
-R d93fe5d7a022d828466356fc5c3d115a
+P e1230782a371f09cd46dacc8ecbc6a0c5baab2d5
+R 34103b151852b68b8447281dee8b52f5
 U drh
-Z b6f25889c2827c3df48865eb571dc2c2
+Z 09fd161899845c827ac24875d31a8565
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFL5FqjoxKgR168RlERAkpDAKCLOKLETC2lxFAjTa52s6k4khvc8QCfas5Z
-/QOnAmlom2QxcknPDDqWyas=
-=uwDy
+iD8DBQFL5HHToxKgR168RlERAruYAJ0VKELfyDrHdFSidCXg6pDgk6NVIgCfW0O4
+0ozplsGsZxT6V2WCirZEVVU=
+=fGE6
 -----END PGP SIGNATURE-----
index f1c557b3637a3279d14a5363c4d1e45be60cc32c..ef38a5f10635aa90347dcf24a058ab1e82932390 100644 (file)
@@ -1 +1 @@
-e1230782a371f09cd46dacc8ecbc6a0c5baab2d5
\ No newline at end of file
+a65c2939267ef6acec4e355a207f98f217e263d6
\ No newline at end of file
index 89a555505db33bc83ac3057d35fdc56ba7087405..0574356940a42a7cbd2125e4dad43e417f3177e8 100644 (file)
@@ -27,6 +27,7 @@
 */
 #include "sqliteInt.h"
 
+#ifndef SQLITE_MUTEX_OMIT
 
 #ifndef SQLITE_DEBUG
 /*
@@ -196,3 +197,4 @@ sqlite3_mutex_methods *sqlite3DefaultMutex(void){
   return sqliteNoopMutex();
 }
 #endif /* SQLITE_MUTEX_NOOP */
+#endif /* SQLITE_MUTEX_OMIT */
index 72cc06a02f2945e61a6be7d26329567da2d19347..b7659dd34d2602ffcab6e198e3015b3bfb0d060b 100644 (file)
@@ -4949,7 +4949,7 @@ static void unixShmPurge(void){
 */
 static int unixShmOpen(
   sqlite3_vfs *pVfs,    /* The VFS */
-  const char *zName,    /* Base name of file to mmap */
+  const char *zName,    /* Name of the corresponding database file */
   sqlite3_shm **pShm    /* Write the unixShm object created here */
 ){
   struct unixShm *p = 0;             /* The connection to be opened */
@@ -4967,14 +4967,14 @@ static int unixShmOpen(
   if( p==0 ) return SQLITE_NOMEM;
   memset(p, 0, sizeof(*p));
   nName = strlen(zName);
-  pNew = sqlite3_malloc( sizeof(*pFile) + nName + 10 );
+  pNew = sqlite3_malloc( sizeof(*pFile) + nName + 15 );
   if( pNew==0 ){
     sqlite3_free(p);
     return SQLITE_NOMEM;
   }
   memset(pNew, 0, sizeof(*pNew));
   pNew->zFilename = (char*)&pNew[1];
-  sqlite3_snprintf(nName+10, pNew->zFilename, "%s-index", zName);
+  sqlite3_snprintf(nName+10, pNew->zFilename, "%s-wal-index", zName);
 
   /* Look to see if there is an existing unixShmFile that can be used.
   ** If no matching unixShmFile currently exists, create a new one.
@@ -5223,9 +5223,8 @@ static int unixShmRelease(sqlite3_vfs *pVfs, sqlite3_shm *pSharedMem){
   unixShm *p = (unixShm*)pSharedMem;
   UNUSED_PARAMETER(pVfs);
   if( p->hasMutexBuf && p->lockState!=SQLITE_SHM_RECOVER ){
-    unixShmFile *pFile = p->pFile;
-    assert( sqlite3_mutex_notheld(pFile->mutex) );
-    sqlite3_mutex_leave(pFile->mutexBuf);
+    assert( sqlite3_mutex_notheld(p->pFile->mutex) );
+    sqlite3_mutex_leave(p->pFile->mutexBuf);
     p->hasMutexBuf = 0;
   }
   return SQLITE_OK;
index ca5fc4e79f35a2e1bec11b7c8b07593c65ccd385..81f63504c10376e96cc5717f764f956d9e91e864 100644 (file)
--- a/src/wal.c
+++ b/src/wal.c
@@ -643,7 +643,7 @@ int sqlite3WalOpen(
   pRet->pFd = (sqlite3_file *)&pRet[1];
   pRet->zName = zWal = pVfs->szOsFile + (char*)pRet->pFd;
   sqlite3_snprintf(nWal+5, zWal, "%s-wal", zDb);
-  rc = pVfs->xShmOpen(pVfs, zWal, &pRet->pWIndex);
+  rc = pVfs->xShmOpen(pVfs, zDb, &pRet->pWIndex);
 
   /* Open file handle on the write-ahead log file. */
   if( rc==SQLITE_OK ){
@@ -1110,7 +1110,7 @@ void sqlite3WalDbsize(Wal *pWal, Pgno *pPgno){
 ** been overwritten by another writer, SQLITE_BUSY is returned.
 */
 int sqlite3WalWriteLock(Wal *pWal, int op){
-  int rc;
+  int rc = SQLITE_OK;
   if( op ){
     assert( pWal->lockState == SQLITE_SHM_READ );
     rc = walSetLock(pWal, SQLITE_SHM_WRITE);
@@ -1209,7 +1209,7 @@ int sqlite3WalFrames(
   u8 aFrame[WAL_FRAME_HDRSIZE];   /* Buffer to assemble frame-header in */
   PgHdr *p;                       /* Iterator to run through pList with. */
   u32 aCksum[2];                  /* Checksums */
-  PgHdr *pLast;                   /* Last frame in list */
+  PgHdr *pLast = 0;               /* Last frame in list */
   int nLast = 0;                  /* Number of extra copies of last page */
 
   assert( WAL_FRAME_HDRSIZE==(4 * 2 + 2*sizeof(u32)) );