]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix os_unix.c so that it works with the test_multiplex module.
authordan <dan@noemail.net>
Fri, 5 Nov 2010 18:07:37 +0000 (18:07 +0000)
committerdan <dan@noemail.net>
Fri, 5 Nov 2010 18:07:37 +0000 (18:07 +0000)
FossilOrigin-Name: 72ba3e368bec34532ec7b5e856a4daa7e1c8cccb

manifest
manifest.uuid
src/os_unix.c

index 430e5fe084c5dd5f7f1f903fa644cd7268e182db..8afa8386cb7ccc6ee14d966135c5b7fe5156a3d2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C More\stests\sand\sadded\ssupport\sfor\sxDelete\sin\smultiplex\sVFS.
-D 2010-11-05T17:51:25
+C Fix\sos_unix.c\sso\sthat\sit\sworks\swith\sthe\stest_multiplex\smodule.
+D 2010-11-05T18:07:37
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in e7a59672eaeb04408d1fa8501618d7501a3c5e39
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -160,7 +160,7 @@ F src/os.c 22ac61d06e72a0dac900400147333b07b13d8e1d
 F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9
 F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
 F src/os_os2.c 72d0b2e562952a2464308c4ce5f7913ac10bef3e
-F src/os_unix.c 00a4a84aba46b61439913bebf0c10d408e42a630
+F src/os_unix.c de5be4cdbf3d07018059934eaf7e5d8d594a895c
 F src/os_win.c 2f90f7bdec714fad51cd31b4ecad3cc1b4bb5aad
 F src/pager.c 1b0e87deb3994abf12e967ef5b9adc950bf85460
 F src/pager.h 8167a1e720d0b7a2790079007128e594010220ad
@@ -885,7 +885,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 1ab9a59237bed6d03b55153a67588486f9adc67b
-R e3f2efd9b864f5e92369281a6cf12f95
-U shaneh
-Z 1f717c7c3b7e6be23615db108e9ab753
+P f2004b44bfba62a7a2296b161a25aefdf55e035a
+R e27a910072d0609871439f0ab30ee53c
+U dan
+Z c8e41ce82005a005e1344343badd82a1
index 7eabec19ae73cb298f30390e51f6ddad1e714a0b..1960777db7ef953211d971bff908ed244d58dac9 100644 (file)
@@ -1 +1 @@
-f2004b44bfba62a7a2296b161a25aefdf55e035a
\ No newline at end of file
+72ba3e368bec34532ec7b5e856a4daa7e1c8cccb
\ No newline at end of file
index 2b38fd6ca17bc260f136d6c7d949d5b45abcf504..9e93a9dcb6ecd6ecc7150a02f57d61088f1a5a2a 100644 (file)
@@ -4431,9 +4431,24 @@ static int findCreateFileMode(
     int nDb;                      /* Number of valid bytes in zDb */
     struct stat sStat;            /* Output of stat() on database file */
 
-    nDb = sqlite3Strlen30(zPath) - ((flags & SQLITE_OPEN_WAL) ? 4 : 8);
+    /* zPath is a path to a WAL or journal file. The following block derives
+    ** the path to the associated database file from zPath. This block handles
+    ** the following naming conventions:
+    **
+    **   "<path to db>-journal"
+    **   "<path to db>-wal"
+    **   "<path to db>-journal-NNNN"
+    **   "<path to db>-wal-NNNN"
+    **
+    ** where NNNN is a 4 digit decimal number. The NNNN naming schemes are 
+    ** used by the test_multiplex.c module.
+    */
+    nDb = sqlite3Strlen30(zPath) - 1; 
+    while( nDb>0 && zPath[nDb]!='l' ) nDb--;
+    nDb -= ((flags & SQLITE_OPEN_WAL) ? 3 : 7);
     memcpy(zDb, zPath, nDb);
     zDb[nDb] = '\0';
+
     if( 0==stat(zDb, &sStat) ){
       *pMode = sStat.st_mode & 0777;
     }else{