]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Update the crash-test VFS in test6.c to pass-through the shared-memory
authordrh <drh@noemail.net>
Mon, 3 May 2010 16:36:55 +0000 (16:36 +0000)
committerdrh <drh@noemail.net>
Mon, 3 May 2010 16:36:55 +0000 (16:36 +0000)
methods to the real underlying VFS.  This fixes the walcrash.test script.

FossilOrigin-Name: ea09ff37911376505e8262ee9841224995b696f2

manifest
manifest.uuid
src/test6.c

index 2fadc888b3f09c3820bdb6771d9286ba556c14be..21c9605bf47120c730388b5c900e91ae614839c4 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-C Change\sthe\sVFS\sdefinition\sso\sthat\sall\smethods\stake\sa\sVFS\sobject\spointer\sas\ntheir\sfirst\sparameter.
-D 2010-05-03T16:30:27
+C Update\sthe\scrash-test\sVFS\sin\stest6.c\sto\spass-through\sthe\sshared-memory\nmethods\sto\sthe\sreal\sunderlying\sVFS.\s\sThis\sfixes\sthe\swalcrash.test\sscript.
+D 2010-05-03T16:36:56
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -181,7 +181,7 @@ F src/test2.c b6b43413d495addd039a88b87d65c839f86b18cb
 F src/test3.c 4c21700c73a890a47fc685c1097bfb661346ac94
 F src/test4.c ad03bb987ddedce928f4258c1e7fa4109a73497d
 F src/test5.c cc55900118fa4add8ec9cf69fc4225a4662f76b1
-F src/test6.c 49b39daf8e88ed6baab25c524ca5635304f6f315
+F src/test6.c 8b9eedc2fee0850636797bcd30a9dd740b449cd7
 F src/test7.c 3f2d63e4ccf97f8c2cf1a7fa0a3c8e2e2a354e6e
 F src/test8.c f959db9a22d882013b64c92753fa793b2ce3bdea
 F src/test9.c bea1e8cf52aa93695487badedd6e1886c321ea60
@@ -811,14 +811,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 7fecd21f45b9ce773ffbcef6c84066474e8cd01c
-R 8a081f2aa3260ab8e76808d511399703
+P 43b5b07f0d996d7ef7426346b1792e9ca898f487
+R a80f3f4ea6ee6aea4b04fb34a6c3ea12
 U drh
-Z 272c621824fe58d9bb0901b6611e7d18
+Z 4c3ef2bd40e742d4d228ff19c85ff350
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFL3vomoxKgR168RlERAtVAAKCH2h/fK4tE1+G5sUz8teeCt8g18QCfUvK9
-AwV097UC6aXg4MmFLWuxDEo=
-=xXDB
+iD8DBQFL3vuroxKgR168RlERAg7YAKCMOaR1lvqjck2/wA1N4NHbOXR7eACdGv8r
+bigNQ81aPV6U5WqfhyJCQhI=
+=VGaH
 -----END PGP SIGNATURE-----
index 7bf37588f149d113bcd4fa313271206f6b866d6a..afb84144970901438c6b839e8ebc2ff942753896 100644 (file)
@@ -1 +1 @@
-43b5b07f0d996d7ef7426346b1792e9ca898f487
\ No newline at end of file
+ea09ff37911376505e8262ee9841224995b696f2
\ No newline at end of file
index 3da9502fd73ea7ca034bfd8002ebfc0964fcd71d..1ebde80e1eb4052d545111a0421f01cb2be3c5d5 100644 (file)
@@ -657,6 +657,33 @@ static int cfCurrentTime(sqlite3_vfs *pCfVfs, double *pTimeOut){
   sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
   return pVfs->xCurrentTime(pVfs, pTimeOut);
 }
+static int cfShmOpen(sqlite3_vfs *pCfVfs, const char *zName, sqlite3_shm **pp){
+  sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
+  return pVfs->xShmOpen(pVfs, zName, pp);
+}
+static int cfShmSize(sqlite3_vfs *pCfVfs, sqlite3_shm *p,
+                     int reqSize, int *pNew){
+  sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
+  return pVfs->xShmSize(pVfs, p, reqSize, pNew);
+}
+static int cfShmGet(sqlite3_vfs *pCfVfs, sqlite3_shm *p,
+                    int reqSize, int *pSize, void **pp){
+  sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
+  return pVfs->xShmGet(pVfs, p, reqSize, pSize, pp);
+}
+static int cfShmRelease(sqlite3_vfs *pCfVfs, sqlite3_shm *p){
+  sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
+  return pVfs->xShmRelease(pVfs, p);
+}
+static int cfShmLock(sqlite3_vfs *pCfVfs, sqlite3_shm *p,
+                     int desiredLock, int *gotLock){
+  sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
+  return pVfs->xShmLock(pVfs, p, desiredLock, gotLock);
+}
+static int cfShmClose(sqlite3_vfs *pCfVfs, sqlite3_shm *p, int delFlag){
+  sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData;
+  return pVfs->xShmClose(pVfs, p, delFlag);
+}
 
 static int processDevSymArgs(
   Tcl_Interp *interp,
@@ -764,7 +791,7 @@ static int crashEnableCmd(
 ){
   int isEnable;
   static sqlite3_vfs crashVfs = {
-    1,                  /* iVersion */
+    2,                  /* iVersion */
     0,                  /* szOsFile */
     0,                  /* mxPathname */
     0,                  /* pNext */
@@ -782,6 +809,15 @@ static int crashEnableCmd(
     cfRandomness,         /* xRandomness */
     cfSleep,              /* xSleep */
     cfCurrentTime,        /* xCurrentTime */
+    0,                    /* xGetlastError */
+    cfShmOpen,            /* xShmOpen */
+    cfShmSize,            /* xShmSize */
+    cfShmGet,             /* xShmGet */
+    cfShmRelease,         /* xShmRelease */
+    cfShmLock,            /* xShmLock */
+    cfShmClose,           /* xShmClose */
+    0,                    /* xRename */
+    0,                    /* xCurrentTimeInt64 */
   };
 
   if( objc!=2 ){
@@ -802,6 +838,11 @@ static int crashEnableCmd(
     crashVfs.mxPathname = pOriginalVfs->mxPathname;
     crashVfs.pAppData = (void *)pOriginalVfs;
     crashVfs.szOsFile = sizeof(CrashFile) + pOriginalVfs->szOsFile;
+    if( pOriginalVfs->iVersion<2 || pOriginalVfs->xShmOpen==0 ){
+      crashVfs.xShmOpen = 0;
+    }else{
+      crashVfs.xShmOpen = cfShmOpen;
+    }
     sqlite3_vfs_register(&crashVfs, 0);
   }else{
     crashVfs.pAppData = 0;