From f922d715700bed98a095a8ac0c19a7c9420b6701 Mon Sep 17 00:00:00 2001 From: shaneh Date: Thu, 4 Nov 2010 20:46:09 +0000 Subject: [PATCH 1/7] Updates for Windows. FossilOrigin-Name: cc9d9a12c3b19320b0ecfa78a6cee3d668004988 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/attachmalloc.test | 9 +++++---- test/permutations.test | 10 ++++++++-- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 62a4db2d42..35d555865b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Include\sthe\sprint_pager_state()\sfunction\sonly\sif\sSQLITE_DEBUG\sis\sdefined. -D 2010-11-04T04:47:43 +C Updates\sfor\sWindows. +D 2010-11-04T20:46:09 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2c8cefd962eca0147132c7cf9eaa4bb24c656f3f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -258,7 +258,7 @@ F test/async5.test f3592d79c84d6e83a5f50d3fd500445f7d97dfdf F test/attach.test ce9660e51768fab93cf129787be886c5d6c4fd81 F test/attach2.test a295d2d7061adcee5884ef4a93c7c96a82765437 F test/attach3.test bd9830bc3a0d22ed1310c9bff6896927937017dc -F test/attachmalloc.test 38d2da5fdaf09ba0add57296967a3061e5842584 +F test/attachmalloc.test 1d5b821a676f7bf0b00d87cc106b78966789ba57 F test/auth.test 26cc6f219580191539bf335abe03e55e49310846 F test/auth2.test 270baddc8b9c273682760cffba6739d907bd2882 F test/auth3.test a4755e6a2a2fea547ffe63c874eb569e60a28eb5 @@ -576,7 +576,7 @@ F test/pageropt.test 8146bf448cf09e87bb1867c2217b921fb5857806 F test/pagesize.test 76aa9f23ecb0741a4ed9d2e16c5fa82671f28efb F test/pcache.test 4118a183908ecaed343a06fcef3ba82e87e0129d F test/pcache2.test 0d85f2ab6963aee28c671d4c71bec038c00a1d16 -F test/permutations.test 193238b7828759805091ecddd9a0912767f236a4 +F test/permutations.test 28d7e1fb31486477d7747508f58fd79f0b6e3a33 F test/pragma.test fdfc09067ea104a0c247a1a79d8093b56656f850 F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47 F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea @@ -883,7 +883,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 31989b18f53d97eddfb39660ef04fbf9463583e0 -R 77870c9f645f63161c757949a10d4b5d -U dan -Z 5b77deb3710cb464f4b30c8cda028e60 +P 3104f17e5dd0be4f176905dde6df3be50ba28702 +R 204c56acbc1eb9022da7f25a997c6f09 +U shaneh +Z ed2bea2e97360a4a06430cbd8896f083 diff --git a/manifest.uuid b/manifest.uuid index b78b77bbc6..8af9191941 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3104f17e5dd0be4f176905dde6df3be50ba28702 \ No newline at end of file +cc9d9a12c3b19320b0ecfa78a6cee3d668004988 \ No newline at end of file diff --git a/test/attachmalloc.test b/test/attachmalloc.test index cc506bee6a..c485c618bd 100644 --- a/test/attachmalloc.test +++ b/test/attachmalloc.test @@ -26,8 +26,9 @@ ifcapable !memdebug||!attach { source $testdir/malloc_common.tcl do_malloc_test attachmalloc-1 -tclprep { - db close + catch { db close } for {set i 2} {$i<=4} {incr i} { + catch { db$i close } file delete -force test$i.db file delete -force test$i.db-journal } @@ -61,13 +62,13 @@ do_malloc_test attachmalloc-2 -tclprep { } set enable_shared_cache [sqlite3_enable_shared_cache 1] -sqlite3 dbaux test2.db +sqlite3 dbaux test3.db dbaux eval {SELECT * FROM sqlite_master} do_malloc_test attachmalloc-3 -sqlbody { SELECT * FROM sqlite_master; - ATTACH 'test2.db' AS two; + ATTACH 'test3.db' AS three; } -cleanup { - db eval { DETACH two } + db eval { DETACH three } } dbaux close sqlite3_enable_shared_cache $enable_shared_cache diff --git a/test/permutations.test b/test/permutations.test index 5576f5bf39..daa8607dfa 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -771,9 +771,15 @@ proc run_tests {name args} { uplevel $options(-initialize) + # uncomment stuff here to skip to a particular test + set skip_to_file "pagerfault.test" + set skip 1 foreach file [lsort $options(-files)] { - if {[file tail $file] == $file} { set file [file join $::testdir $file] } - slave_test_file $file + if {[file tail $file] == $skip_to_file} { set skip 0 } + if {$skip == 0} { + if {[file tail $file] == $file} { set file [file join $::testdir $file] } + slave_test_file $file + } } uplevel $options(-shutdown) From 7a420e227c4c30a8e43f8d4eb7562b34e0ec9ab7 Mon Sep 17 00:00:00 2001 From: shaneh Date: Thu, 4 Nov 2010 20:47:44 +0000 Subject: [PATCH 2/7] Fix size so it's really 32x32. FossilOrigin-Name: 62c494f6947e53808404081c8f48cc327ef814e7 --- art/sqlite370.ico | Bin 2238 -> 2238 bytes manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/art/sqlite370.ico b/art/sqlite370.ico index ff257e75ae8ba57dbd4528720303cf262dc0e635..0e8139434b269a3c61e96425e4766a1b3c7486cf 100644 GIT binary patch literal 2238 zcmeH}zfQw25XSHFr>T$v6$2|_V`F7OWoBe!VM4q@C6*!q3#=>*z={Ms08=U-yo-fkqewRiM2lRfuPEVKH^!52nXT1%&z3S1&TTcD`6}mXxq2c45 zWjGtoPGEKd|Lp`ie$4q3-ZgvIolf9Hg$I!xsn1;;HF0iO-^82z!QBep{un>DPJ+u* z=8&BPmxJ-VlMp0!2uA^{LWQ@4|0cLR0SZ%&$-uqR&YSI ZqF*kwfL@do3ek(W)Bxi#grY~#9vS0hl98jEG~Y8E`qa*;O3%>_!TNH*FhIuT^!U^P(Of^1#zh^ z;$XKzcX91@K5ueubC;_+xCnjAlP3ASf07pt0x16K%b-%z3TczsMI;FU8Oxr&* zDvnef$JpD@csbJe>>lIwYythd9rW)H@qX3B)5R7(2G2Nct>Nafh2Gl(qWuQWPqxv0 zymb=Jrn3&rI`H2*5N1rdYhK1(%G~FLlzF_MT~k?}##&X~f~^17{HOZLy`f*fNy=3rarIHLNeHR_j_^Xf~7ysR%SY9`X9&9P}D&*Y*X;G%e_siOckjWszHGY iMF*TW`SuVk0h*ErM Date: Thu, 4 Nov 2010 20:50:27 +0000 Subject: [PATCH 3/7] First attempt at a sharding VFS to split large DBs. FossilOrigin-Name: dd4dc8a4269e23ffe0e18438690da6077e17cdad --- manifest | 14 +- manifest.uuid | 2 +- src/tclsqlite.c | 2 + src/test_multiplex.c | 816 +++++++++++++++++++++++++++++++++++++++++++ test/multiplex.test | 306 ++++++++++++++++ 5 files changed, 1133 insertions(+), 7 deletions(-) create mode 100644 src/test_multiplex.c create mode 100644 test/multiplex.test diff --git a/manifest b/manifest index 9c6262987b..7081b63415 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssize\sso\sit's\sreally\s32x32. -D 2010-11-04T20:47:44 +C First\sattempt\sat\sa\ssharding\sVFS\sto\ssplit\slarge\sDBs. +D 2010-11-04T20:50:27 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2c8cefd962eca0147132c7cf9eaa4bb24c656f3f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -182,7 +182,7 @@ F src/sqliteInt.h c63b0340dfdfde18ff255ddccf004edd2d073288 F src/sqliteLimit.h a17dcd3fb775d63b64a43a55c54cb282f9726f44 F src/status.c 496913d4e8441195f6f2a75b1c95993a45b9b30b F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e -F src/tclsqlite.c dc71e2bd0f16dbb9106c1f5e257a64b783574f26 +F src/tclsqlite.c e1c485fa323e3ef02e5b10fe6a016e7638013eb9 F src/test1.c 9e1fe842f72aa41af48ab7b21c3a12975b4c5b37 F src/test2.c 80d323d11e909cf0eb1b6fbb4ac22276483bcf31 F src/test3.c 056093cfef69ff4227a6bdb9108564dc7f45e4bc @@ -207,6 +207,7 @@ F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 F src/test_journal.c 785edd54f963aefb3c1628124170a56697c68c70 F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e F src/test_malloc.c 09a88f0c111201dc4f8c20470aa1b5f611d59200 +F src/test_multiplex.c be9c1445dca81ab9c77278b85b827cd446c656a8 F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3 F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec F src/test_osinst.c f408c6a181f2fb04c56273afd5c3e1e82f60392c @@ -558,6 +559,7 @@ F test/misc5.test 45b2e3ed5f79af2b4f38ae362eaf4c49674575bd F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91 F test/misc7.test c5f4e6a82e04e71820c0f9f64f6733f04c8ae0ae F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33 +F test/multiplex.test 257af7decc32a50814adffbb6865e1a7eb9f42c3 F test/mutex1.test 5b71777fc127509cd257910c8db799de557a02de F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660 F test/nan.test a44e04df1486fcfb02d32468cbcd3c8e1e433723 @@ -883,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 cc9d9a12c3b19320b0ecfa78a6cee3d668004988 -R 0b84c10fec00628f99d964887ecf071d +P 62c494f6947e53808404081c8f48cc327ef814e7 +R 081ff33d1b2f0f16499724ab46c0e8b9 U shaneh -Z 2c70e7d440c064ec216e31a9c4e6aaa8 +Z fa2a353cd6df65e68d308d8dfcf83710 diff --git a/manifest.uuid b/manifest.uuid index 193df92131..6328c230be 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -62c494f6947e53808404081c8f48cc327ef814e7 \ No newline at end of file +dd4dc8a4269e23ffe0e18438690da6077e17cdad \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 471b0d3fb1..13796bed2f 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -3579,6 +3579,7 @@ static void init_all(Tcl_Interp *interp){ extern int SqlitetestStat_Init(Tcl_Interp*); extern int Sqlitetestrtree_Init(Tcl_Interp*); extern int Sqlitequota_Init(Tcl_Interp*); + extern int Sqlitemultiplex_Init(Tcl_Interp*); Sqliteconfig_Init(interp); Sqlitetest1_Init(interp); @@ -3609,6 +3610,7 @@ static void init_all(Tcl_Interp *interp){ SqlitetestStat_Init(interp); Sqlitetestrtree_Init(interp); Sqlitequota_Init(interp); + Sqlitemultiplex_Init(interp); Tcl_CreateObjCommand(interp,"load_testfixture_extensions",init_all_cmd,0,0); diff --git a/src/test_multiplex.c b/src/test_multiplex.c new file mode 100644 index 0000000000..d8c047300b --- /dev/null +++ b/src/test_multiplex.c @@ -0,0 +1,816 @@ +/* +** 2010 October 28 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file contains a VFS "shim" - a layer that sits in between the +** pager and the real VFS. +** +** This particular shim enforces a multiplex system on DB files. +** This shim shards/partitions a single DB file into smaller +** "chunks" such that the total DB file size may exceed the maximum +** file size of the underlying file system. +** +*/ +#include "sqlite3.h" +#include +#include +#include "sqliteInt.h" + +/************************ Shim Definitions ******************************/ + +#define SQLITE_MULTIPLEX_CHUNK_SIZE 0x80000000 +#define SQLITE_MULTIPLEX_MAX_CHUNKS 32 + +/************************ Object Definitions ******************************/ + +/* Forward declaration of all object types */ +typedef struct multiplexGroup multiplexGroup; +typedef struct multiplexConn multiplexConn; + +/* +** A "multiplex group" is a collection of files that collectively +** makeup a single SQLite DB file. This allows the size of the DB +** to exceed the limits imposed by the file system. +** +** There is an instance of the following object for each defined multiplex +** group. +*/ +struct multiplexGroup { + sqlite3_file *pReal[SQLITE_MULTIPLEX_MAX_CHUNKS]; /* Handles to each chunk */ + char bOpen[SQLITE_MULTIPLEX_MAX_CHUNKS]; /* 0 if chunk not opened */ + char *zName; /* Base filename of this group */ + int nName; /* Length of base filename */ + int flags; /* Flags used for original opening */ + multiplexGroup *pNext, *pPrev; /* Doubly linked list of all group objects */ +}; + +/* +** An instance of the following object represents each open connection +** to a file that is multiplex'ed. This object is a +** subclass of sqlite3_file. The sqlite3_file object for the underlying +** VFS is appended to this structure. +*/ +struct multiplexConn { + sqlite3_file base; /* Base class - must be first */ + multiplexGroup *pGroup; /* The underlying group of files */ +}; + +/************************* Global Variables **********************************/ +/* +** All global variables used by this file are containing within the following +** gMultiplex structure. +*/ +static struct { + /* The pOrigVfs is the real, original underlying VFS implementation. + ** Most operations pass-through to the real VFS. This value is read-only + ** during operation. It is only modified at start-time and thus does not + ** require a mutex. + */ + sqlite3_vfs *pOrigVfs; + + /* The sThisVfs is the VFS structure used by this shim. It is initialized + ** at start-time and thus does not require a mutex + */ + sqlite3_vfs sThisVfs; + + /* The sIoMethods defines the methods used by sqlite3_file objects + ** associated with this shim. It is initialized at start-time and does + ** not require a mutex. + ** + ** When the underlying VFS is called to open a file, it might return + ** either a version 1 or a version 2 sqlite3_file object. This shim + ** has to create a wrapper sqlite3_file of the same version. Hence + ** there are two I/O method structures, one for version 1 and the other + ** for version 2. + */ + sqlite3_io_methods sIoMethodsV1; + sqlite3_io_methods sIoMethodsV2; + + /* True when this shim as been initialized. + */ + int isInitialized; + + /* For run-time access any of the other global data structures in this + ** shim, the following mutex must be held. + */ + sqlite3_mutex *pMutex; + + /* List of multiplexGroup objects. + */ + multiplexGroup *pGroups; + + /* Chunk params + */ + int nChunkSize; + int nMaxChunks; + +} gMultiplex; + +/************************* Utility Routines *********************************/ +/* +** Acquire and release the mutex used to serialize access to the +** list of multiplexGroups. +*/ +static void multiplexEnter(void){ sqlite3_mutex_enter(gMultiplex.pMutex); } +static void multiplexLeave(void){ sqlite3_mutex_leave(gMultiplex.pMutex); } + +/* Translate an sqlite3_file* that is really a multiplexGroup* into +** the sqlite3_file* for the underlying original VFS. +*/ +static sqlite3_file *multiplexSubOpen(multiplexConn *pConn, int iChunk, int *rc, int *pOutFlags){ + multiplexGroup *pGroup = pConn->pGroup; + sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs; /* Real VFS */ + if( iChunkpReal[iChunk]; /* Real file descriptor */ + if( !pGroup->bOpen[iChunk] ){ + pGroup->zName[pGroup->nName] = '\0'; + if( iChunk ) sqlite3_snprintf(pGroup->nName+6, pGroup->zName+pGroup->nName, "-%04d", iChunk); + *rc = pOrigVfs->xOpen(pOrigVfs, pGroup->zName, pSubOpen, pGroup->flags, pOutFlags); + if( *rc==SQLITE_OK ){ + pGroup->bOpen[iChunk] = -1; + return pSubOpen; + } + return NULL; + } + *rc = SQLITE_OK; + return pSubOpen; + } + *rc = SQLITE_ERROR; + return NULL; +} + +/************************* VFS Method Wrappers *****************************/ +/* +** This is the xOpen method used for the "multiplex" VFS. +** +** Most of the work is done by the underlying original VFS. This method +** simply links the new file into the appropriate multiplex group if it is a +** file that needs to be tracked. +*/ +static int multiplexOpen( + sqlite3_vfs *pVfs, /* The multiplex VFS */ + const char *zName, /* Name of file to be opened */ + sqlite3_file *pConn, /* Fill in this file descriptor */ + int flags, /* Flags to control the opening */ + int *pOutFlags /* Flags showing results of opening */ +){ + int rc; /* Result code */ + multiplexConn *pMultiplexOpen; /* The new multiplex file descriptor */ + multiplexGroup *pGroup; /* Corresponding multiplexGroup object */ + sqlite3_file *pSubOpen; /* Real file descriptor */ + sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs; /* Real VFS */ + int nName = sqlite3Strlen30(zName); + int i; + + UNUSED_PARAMETER(pVfs); + + /* If the file is not a main database file or a WAL, then use the + ** normal xOpen method. + */ + if( (flags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL))==0 ){ + return pOrigVfs->xOpen(pOrigVfs, zName, pConn, flags, pOutFlags); + } + + /* We need to create a group structure and manage + ** access to this group of files. + */ + multiplexEnter(); + pMultiplexOpen = (multiplexConn*)pConn; + /* -0000\0 */ + pGroup = sqlite3_malloc( sizeof(multiplexGroup) + (pOrigVfs->szOsFile*gMultiplex.nMaxChunks) + nName + 6 ); + if( pGroup==0 ){ + rc=SQLITE_NOMEM; + }else{ + pMultiplexOpen->pGroup = pGroup; + memset(pGroup, 0, sizeof(multiplexGroup) + (pOrigVfs->szOsFile*gMultiplex.nMaxChunks) + nName + 6); + for(i=0; ipReal[i] = (sqlite3_file *)((char *)&pGroup[1] + (pOrigVfs->szOsFile*i)); + } + pGroup->zName = (char *)&pGroup[1] + (pOrigVfs->szOsFile*gMultiplex.nMaxChunks); + memcpy(pGroup->zName, zName, nName+1); + pGroup->nName = nName; + pGroup->flags = flags; + pSubOpen = multiplexSubOpen(pMultiplexOpen, 0, &rc, pOutFlags); + if( pSubOpen ){ + if( pSubOpen->pMethods->iVersion==1 ){ + pMultiplexOpen->base.pMethods = &gMultiplex.sIoMethodsV1; + }else{ + pMultiplexOpen->base.pMethods = &gMultiplex.sIoMethodsV2; + } + /* place this group at the head of our list */ + pGroup->pNext = gMultiplex.pGroups; + if( gMultiplex.pGroups ) gMultiplex.pGroups->pPrev = pGroup; + gMultiplex.pGroups = pGroup; + }else{ + sqlite3_free(pGroup); + } + } + multiplexLeave(); + return rc; +} + +/************************ I/O Method Wrappers *******************************/ + +/* xClose requests get passed through to the original VFS. +** We loop over all open chunk handles and close them. +** The group structure for this file is unlinked from +** our list of groups and freed. +*/ +static int multiplexClose(sqlite3_file *pConn){ + multiplexConn *p = (multiplexConn*)pConn; + multiplexGroup *pGroup = p->pGroup; + int rc = SQLITE_OK; + int i; + multiplexEnter(); + for(i=0; ibOpen[i] ){ + sqlite3_file *pSubOpen = pGroup->pReal[i]; + int rc2 = pSubOpen->pMethods->xClose(pSubOpen); + if( rc2!=SQLITE_OK ) rc = rc2; + pGroup->bOpen[i] = 0; + } + } + if( pGroup->pNext ) pGroup->pNext->pPrev = pGroup->pPrev; + if( pGroup->pPrev ){ + pGroup->pPrev->pNext = pGroup->pNext; + }else{ + gMultiplex.pGroups = pGroup->pNext; + } + sqlite3_free(pGroup); + multiplexLeave(); + return rc; +} + +/* Pass xRead requests thru to the original VFS after +** determining the correct chunk to operate on. +*/ +static int multiplexRead( + sqlite3_file *pConn, + void *pBuf, + int iAmt, + sqlite3_int64 iOfst +){ + multiplexConn *p = (multiplexConn*)pConn; + int rc = SQLITE_OK; + multiplexEnter(); + while( iAmt > 0 ){ + int i = (int)(iOfst/gMultiplex.nChunkSize); + sqlite3_file *pSubOpen = multiplexSubOpen(p, i, &rc, NULL); + if( pSubOpen ){ + int extra = ((int)(iOfst % gMultiplex.nChunkSize) + iAmt) - gMultiplex.nChunkSize; + if( extra<0 ) extra = 0; + iAmt -= extra; + rc = pSubOpen->pMethods->xRead(pSubOpen, pBuf, iAmt, iOfst%gMultiplex.nChunkSize); + if( rc!=SQLITE_OK ) break; + pBuf = (char *)pBuf + iAmt; + iOfst += iAmt; + iAmt = extra; + }else{ + rc = SQLITE_IOERR_READ; + break; + } + } + multiplexLeave(); + return rc; +} + +/* Pass xWrite requests thru to the original VFS after +** determining the correct chunk to operate on. +*/ +static int multiplexWrite( + sqlite3_file *pConn, + const void *pBuf, + int iAmt, + sqlite3_int64 iOfst +){ + multiplexConn *p = (multiplexConn*)pConn; + int rc = SQLITE_OK; + multiplexEnter(); + while( iAmt > 0 ){ + int i = (int)(iOfst/gMultiplex.nChunkSize); + sqlite3_file *pSubOpen = multiplexSubOpen(p, i, &rc, NULL); + if( pSubOpen ){ + int extra = ((int)(iOfst % gMultiplex.nChunkSize) + iAmt) - gMultiplex.nChunkSize; + if( extra<0 ) extra = 0; + iAmt -= extra; + rc = pSubOpen->pMethods->xWrite(pSubOpen, pBuf, iAmt, iOfst%gMultiplex.nChunkSize); + if( rc!=SQLITE_OK ) break; + pBuf = (char *)pBuf + iAmt; + iOfst += iAmt; + iAmt = extra; + }else{ + rc = SQLITE_IOERR_WRITE; + break; + } + } + multiplexLeave(); + return rc; +} + +/* Pass xTruncate requests thru to the original VFS after +** determining the correct chunk to operate on. Delete any +** chunks above the truncate mark. +*/ +static int multiplexTruncate(sqlite3_file *pConn, sqlite3_int64 size){ + multiplexConn *p = (multiplexConn*)pConn; + multiplexGroup *pGroup = p->pGroup; + int rc = SQLITE_OK; + int rc2; + int i; + sqlite3_file *pSubOpen; + sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs; /* Real VFS */ + multiplexEnter(); + /* delete the chunks above the truncate limit */ + for(i=(int)(size/gMultiplex.nChunkSize)+1; ibOpen[i] ){ + pSubOpen = pGroup->pReal[i]; + rc2 = pSubOpen->pMethods->xClose(pSubOpen); + if( rc2!=SQLITE_OK ) rc = SQLITE_IOERR_TRUNCATE; + } + pGroup->zName[pGroup->nName] = '\0'; + if( i ) sqlite3_snprintf(pGroup->nName+6, pGroup->zName+pGroup->nName, "-%04d", i); + rc2 = pOrigVfs->xDelete(pOrigVfs, pGroup->zName, 0); + if( rc2!=SQLITE_OK ) rc = SQLITE_IOERR_TRUNCATE; + } + pSubOpen = multiplexSubOpen(p, (int)(size/gMultiplex.nChunkSize), &rc2, NULL); + if( pSubOpen ){ + rc2 = pSubOpen->pMethods->xTruncate(pSubOpen, size%gMultiplex.nChunkSize); + if( rc2!=SQLITE_OK ) rc = rc2; + }else{ + rc = SQLITE_IOERR_TRUNCATE; + } + multiplexLeave(); + return rc; +} + +/* Pass xSync requests through to the original VFS without change +*/ +static int multiplexSync(sqlite3_file *pConn, int flags){ + multiplexConn *p = (multiplexConn*)pConn; + multiplexGroup *pGroup = p->pGroup; + int rc = SQLITE_OK; + int i; + multiplexEnter(); + for(i=0; ibOpen[i] ){ + sqlite3_file *pSubOpen = pGroup->pReal[i]; + int rc2 = pSubOpen->pMethods->xSync(pSubOpen, flags); + if( rc2!=SQLITE_OK ) rc = rc2; + } + } + multiplexLeave(); + return rc; +} + +/* Pass xFileSize requests through to the original VFS. +** Aggregate the size of all the chunks before returning. +*/ +static int multiplexFileSize(sqlite3_file *pConn, sqlite3_int64 *pSize){ + multiplexConn *p = (multiplexConn*)pConn; + multiplexGroup *pGroup = p->pGroup; + int rc = SQLITE_OK; + int rc2; + int i; + multiplexEnter(); + *pSize = 0; + for(i=0; ibOpen[i] ){ + pSubOpen = pGroup->pReal[i]; + }else{ + sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs; /* Real VFS */ + int exists = 0; + pGroup->zName[pGroup->nName] = '\0'; + if( i ) sqlite3_snprintf(pGroup->nName+6, pGroup->zName+pGroup->nName, "-%04d", i); + rc2 = pOrigVfs->xAccess(pOrigVfs, pGroup->zName, SQLITE_ACCESS_EXISTS, &exists); + if( rc2==SQLITE_OK && exists){ + /* if it exists, open it */ + pSubOpen = multiplexSubOpen(p, i, &rc, NULL); + }else{ + /* stop at first "gap" */ + break; + } + } + if( pSubOpen ){ + rc2 = pSubOpen->pMethods->xFileSize(pSubOpen, &sz); + if( rc2!=SQLITE_OK ){ + rc = rc2; + }else{ + *pSize += sz; + } + }else{ + break; + } + } + multiplexLeave(); + return rc; +} + +/* Pass xLock requests through to the original VFS unchanged. +*/ +static int multiplexLock(sqlite3_file *pConn, int lock){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xLock(pSubOpen, lock); + } + return SQLITE_BUSY; +} + +/* Pass xUnlock requests through to the original VFS unchanged. +*/ +static int multiplexUnlock(sqlite3_file *pConn, int lock){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xUnlock(pSubOpen, lock); + } + return SQLITE_IOERR_UNLOCK; +} + +/* Pass xCheckReservedLock requests through to the original VFS unchanged. +*/ +static int multiplexCheckReservedLock(sqlite3_file *pConn, int *pResOut){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xCheckReservedLock(pSubOpen, pResOut); + } + return SQLITE_IOERR_CHECKRESERVEDLOCK; +} + +/* Pass xFileControl requests through to the original VFS unchanged. +*/ +static int multiplexFileControl(sqlite3_file *pConn, int op, void *pArg){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen; + if ( op==SQLITE_FCNTL_SIZE_HINT || op==SQLITE_FCNTL_CHUNK_SIZE ) return SQLITE_OK; + pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xFileControl(pSubOpen, op, pArg); + } + return SQLITE_ERROR; +} + +/* Pass xSectorSize requests through to the original VFS unchanged. +*/ +static int multiplexSectorSize(sqlite3_file *pConn){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xSectorSize(pSubOpen); + } + return SQLITE_DEFAULT_SECTOR_SIZE; +} + +/* Pass xDeviceCharacteristics requests through to the original VFS unchanged. +*/ +static int multiplexDeviceCharacteristics(sqlite3_file *pConn){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xDeviceCharacteristics(pSubOpen); + } + return 0; +} + +/* Pass xShmMap requests through to the original VFS unchanged. +*/ +static int multiplexShmMap( + sqlite3_file *pConn, /* Handle open on database file */ + int iRegion, /* Region to retrieve */ + int szRegion, /* Size of regions */ + int bExtend, /* True to extend file if necessary */ + void volatile **pp /* OUT: Mapped memory */ +){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xShmMap(pSubOpen, iRegion, szRegion, bExtend, pp); + } + return SQLITE_IOERR; +} + +/* Pass xShmLock requests through to the original VFS unchanged. +*/ +static int multiplexShmLock( + sqlite3_file *pConn, /* Database file holding the shared memory */ + int ofst, /* First lock to acquire or release */ + int n, /* Number of locks to acquire or release */ + int flags /* What to do with the lock */ +){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xShmLock(pSubOpen, ofst, n, flags); + } + return SQLITE_BUSY; +} + +/* Pass xShmBarrier requests through to the original VFS unchanged. +*/ +static void multiplexShmBarrier(sqlite3_file *pConn){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + pSubOpen->pMethods->xShmBarrier(pSubOpen); + } +} + +/* Pass xShmUnmap requests through to the original VFS unchanged. +*/ +static int multiplexShmUnmap(sqlite3_file *pConn, int deleteFlag){ + multiplexConn *p = (multiplexConn*)pConn; + int rc; + sqlite3_file *pSubOpen = multiplexSubOpen(p, 0, &rc, NULL); + if( pSubOpen ){ + return pSubOpen->pMethods->xShmUnmap(pSubOpen, deleteFlag); + } + return SQLITE_OK; +} + +/************************** Public Interfaces *****************************/ +/* +** Initialize the multiplex VFS shim. Use the VFS named zOrigVfsName +** as the VFS that does the actual work. Use the default if +** zOrigVfsName==NULL. +** +** The multiplex VFS shim is named "multiplex". It will become the default +** VFS if makeDefault is non-zero. +** +** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once +** during start-up. +*/ +int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault){ + sqlite3_vfs *pOrigVfs; + if( gMultiplex.isInitialized ) return SQLITE_MISUSE; + pOrigVfs = sqlite3_vfs_find(zOrigVfsName); + if( pOrigVfs==0 ) return SQLITE_ERROR; + assert( pOrigVfs!=&gMultiplex.sThisVfs ); + gMultiplex.pMutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST); + if( !gMultiplex.pMutex ){ + return SQLITE_NOMEM; + } + gMultiplex.nChunkSize = SQLITE_MULTIPLEX_CHUNK_SIZE; + gMultiplex.nMaxChunks = SQLITE_MULTIPLEX_MAX_CHUNKS; + gMultiplex.pGroups = NULL; + gMultiplex.isInitialized = 1; + gMultiplex.pOrigVfs = pOrigVfs; + gMultiplex.sThisVfs = *pOrigVfs; + gMultiplex.sThisVfs.szOsFile += sizeof(multiplexConn); + gMultiplex.sThisVfs.zName = "multiplex"; + gMultiplex.sThisVfs.xOpen = multiplexOpen; + gMultiplex.sIoMethodsV1.iVersion = 1; + gMultiplex.sIoMethodsV1.xClose = multiplexClose; + gMultiplex.sIoMethodsV1.xRead = multiplexRead; + gMultiplex.sIoMethodsV1.xWrite = multiplexWrite; + gMultiplex.sIoMethodsV1.xTruncate = multiplexTruncate; + gMultiplex.sIoMethodsV1.xSync = multiplexSync; + gMultiplex.sIoMethodsV1.xFileSize = multiplexFileSize; + gMultiplex.sIoMethodsV1.xLock = multiplexLock; + gMultiplex.sIoMethodsV1.xUnlock = multiplexUnlock; + gMultiplex.sIoMethodsV1.xCheckReservedLock = multiplexCheckReservedLock; + gMultiplex.sIoMethodsV1.xFileControl = multiplexFileControl; + gMultiplex.sIoMethodsV1.xSectorSize = multiplexSectorSize; + gMultiplex.sIoMethodsV1.xDeviceCharacteristics = multiplexDeviceCharacteristics; + gMultiplex.sIoMethodsV2 = gMultiplex.sIoMethodsV1; + gMultiplex.sIoMethodsV2.iVersion = 2; + gMultiplex.sIoMethodsV2.xShmMap = multiplexShmMap; + gMultiplex.sIoMethodsV2.xShmLock = multiplexShmLock; + gMultiplex.sIoMethodsV2.xShmBarrier = multiplexShmBarrier; + gMultiplex.sIoMethodsV2.xShmUnmap = multiplexShmUnmap; + sqlite3_vfs_register(&gMultiplex.sThisVfs, makeDefault); + return SQLITE_OK; +} + +/* +** Shutdown the multiplex system. +** +** All SQLite database connections must be closed before calling this +** routine. +** +** THIS ROUTINE IS NOT THREADSAFE. Call this routine exactly once while +** shutting down in order to free all remaining multiplex groups. +*/ +int sqlite3_multiplex_shutdown(void){ + if( gMultiplex.isInitialized==0 ) return SQLITE_MISUSE; + if( gMultiplex.pGroups ) return SQLITE_MISUSE; + gMultiplex.isInitialized = 0; + sqlite3_mutex_free(gMultiplex.pMutex); + sqlite3_vfs_unregister(&gMultiplex.sThisVfs); + memset(&gMultiplex, 0, sizeof(gMultiplex)); + return SQLITE_OK; +} + +/* +** Adjust chunking params. VFS should be initialized first. +** No files should be open. Re-intializing will reset these +** to the default. +*/ +int sqlite3_multiplex_set( + int nChunkSize, /* Max chunk size */ + int nMaxChunks /* Max number of chunks */ +){ + if( !gMultiplex.isInitialized ) return SQLITE_MISUSE; + if( gMultiplex.pGroups ) return SQLITE_MISUSE; + if( nMaxChunks>SQLITE_MULTIPLEX_MAX_CHUNKS ) return SQLITE_MISUSE; + multiplexEnter(); + gMultiplex.nChunkSize = nChunkSize; + gMultiplex.nMaxChunks = nMaxChunks; + multiplexLeave(); + return SQLITE_OK; +} + +/***************************** Test Code ***********************************/ +#ifdef SQLITE_TEST +#include + +extern const char *sqlite3TestErrorName(int); + + +/* +** tclcmd: sqlite3_multiplex_initialize NAME MAKEDEFAULT +*/ +static int test_multiplex_initialize( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + const char *zName; /* Name of new multiplex VFS */ + int makeDefault; /* True to make the new VFS the default */ + int rc; /* Value returned by multiplex_initialize() */ + + UNUSED_PARAMETER(clientData); + + /* Process arguments */ + if( objc!=3 ){ + Tcl_WrongNumArgs(interp, 1, objv, "NAME MAKEDEFAULT"); + return TCL_ERROR; + } + zName = Tcl_GetString(objv[1]); + if( Tcl_GetBooleanFromObj(interp, objv[2], &makeDefault) ) return TCL_ERROR; + if( zName[0]=='\0' ) zName = 0; + + /* Call sqlite3_multiplex_initialize() */ + rc = sqlite3_multiplex_initialize(zName, makeDefault); + Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC); + + return TCL_OK; +} + +/* +** tclcmd: sqlite3_multiplex_shutdown +*/ +static int test_multiplex_shutdown( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int rc; /* Value returned by multiplex_shutdown() */ + + UNUSED_PARAMETER(clientData); + + if( objc!=1 ){ + Tcl_WrongNumArgs(interp, 1, objv, ""); + return TCL_ERROR; + } + + /* Call sqlite3_multiplex_shutdown() */ + rc = sqlite3_multiplex_shutdown(); + Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC); + + return TCL_OK; +} + +/* +** tclcmd: sqlite3_multiplex_set CHUNK_SIZE MAX_CHUNKS +*/ +static int test_multiplex_set( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int nChunkSize; /* Max chunk size */ + int nMaxChunks; /* Max number of chunks */ + int rc; /* Value returned by sqlite3_multiplex_set() */ + + UNUSED_PARAMETER(clientData); + + /* Process arguments */ + if( objc!=3 ){ + Tcl_WrongNumArgs(interp, 1, objv, "CHUNK_SIZE MAX_CHUNKS"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, objv[1], &nChunkSize) ) return TCL_ERROR; + if( Tcl_GetIntFromObj(interp, objv[2], &nMaxChunks) ) return TCL_ERROR; + + if( nMaxChunks>SQLITE_MULTIPLEX_MAX_CHUNKS ){ + Tcl_WrongNumArgs(interp, 1, objv, "MAX_CHUNKS > SQLITE_MULTIPLEX_MAX_CHUNKS"); + return TCL_ERROR; + } + + /* Invoke sqlite3_multiplex_set() */ + rc = sqlite3_multiplex_set(nChunkSize, nMaxChunks); + + Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC); + return TCL_OK; +} + +/* +** tclcmd: sqlite3_multiplex_dump +*/ +static int test_multiplex_dump( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + Tcl_Obj *pResult; + Tcl_Obj *pGroupTerm; + multiplexGroup *pGroup; + int i; + int nChunks = 0; + + UNUSED_PARAMETER(clientData); + UNUSED_PARAMETER(objc); + UNUSED_PARAMETER(objv); + + pResult = Tcl_NewObj(); + multiplexEnter(); + for(pGroup=gMultiplex.pGroups; pGroup; pGroup=pGroup->pNext){ + pGroupTerm = Tcl_NewObj(); + + pGroup->zName[pGroup->nName] = '\0'; + Tcl_ListObjAppendElement(interp, pGroupTerm, + Tcl_NewStringObj(pGroup->zName, -1)); + Tcl_ListObjAppendElement(interp, pGroupTerm, + Tcl_NewIntObj(pGroup->nName)); + Tcl_ListObjAppendElement(interp, pGroupTerm, + Tcl_NewIntObj(pGroup->flags)); + + /* count number of chunks with open handles */ + for(i=0; ibOpen[i] ) nChunks++; + } + Tcl_ListObjAppendElement(interp, pGroupTerm, + Tcl_NewIntObj(nChunks)); + + Tcl_ListObjAppendElement(interp, pGroupTerm, + Tcl_NewIntObj(gMultiplex.nChunkSize)); + Tcl_ListObjAppendElement(interp, pGroupTerm, + Tcl_NewIntObj(gMultiplex.nMaxChunks)); + + Tcl_ListObjAppendElement(interp, pResult, pGroupTerm); + } + multiplexLeave(); + Tcl_SetObjResult(interp, pResult); + return TCL_OK; +} + +/* +** This routine registers the custom TCL commands defined in this +** module. This should be the only procedure visible from outside +** of this module. +*/ +int Sqlitemultiplex_Init(Tcl_Interp *interp){ + static struct { + char *zName; + Tcl_ObjCmdProc *xProc; + } aCmd[] = { + { "sqlite3_multiplex_initialize", test_multiplex_initialize }, + { "sqlite3_multiplex_shutdown", test_multiplex_shutdown }, + { "sqlite3_multiplex_set", test_multiplex_set }, + { "sqlite3_multiplex_dump", test_multiplex_dump }, + }; + int i; + + for(i=0; i Date: Thu, 4 Nov 2010 21:03:47 +0000 Subject: [PATCH 4/7] Fix the main.mk makefile to include test_multiplex.c for testfixture. FossilOrigin-Name: c27c51180e88744939ba5af099b6e510968ed2c3 --- main.mk | 1 + manifest | 24 +++++++++++++++++------- manifest.uuid | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/main.mk b/main.mk index 6870c29b07..032e67e423 100644 --- a/main.mk +++ b/main.mk @@ -241,6 +241,7 @@ TESTSRC = \ $(TOP)/src/test_intarray.c \ $(TOP)/src/test_journal.c \ $(TOP)/src/test_malloc.c \ + $(TOP)/src/test_multiplex.c \ $(TOP)/src/test_mutex.c \ $(TOP)/src/test_onefile.c \ $(TOP)/src/test_osinst.c \ diff --git a/manifest b/manifest index 7081b63415..206dd5813c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C First\sattempt\sat\sa\ssharding\sVFS\sto\ssplit\slarge\sDBs. -D 2010-11-04T20:50:27 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C Fix\sthe\smain.mk\smakefile\sto\sinclude\stest_multiplex.c\sfor\stestfixture. +D 2010-11-04T21:03:47 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2c8cefd962eca0147132c7cf9eaa4bb24c656f3f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -99,7 +102,7 @@ F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 -F main.mk bcbaa8d5dbdf49c35c506321850158e1237563c1 +F main.mk 497c8cb6ae132c88fa184e5e454b0e6336da5693 F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a F mkextu.sh 416f9b7089d80e5590a29692c9d9280a10dbad9f F mkextw.sh 4123480947681d9b434a5e7b1ee08135abe409ac @@ -885,7 +888,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 62c494f6947e53808404081c8f48cc327ef814e7 -R 081ff33d1b2f0f16499724ab46c0e8b9 -U shaneh -Z fa2a353cd6df65e68d308d8dfcf83710 +P dd4dc8a4269e23ffe0e18438690da6077e17cdad +R f3b8f733ce6b1e935135e12bc066b859 +U drh +Z cbbc50b0b1fbc9c52770b191d7e4d95b +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQFM0x+2oxKgR168RlERAt0NAJ0YYnBOt4BVXCmrJ15SRL6/J21eBwCeOx8T +W8FvV7zDRiGNGHvyFtdeHi8= +=J2pj +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 6328c230be..41c1ea25f1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dd4dc8a4269e23ffe0e18438690da6077e17cdad \ No newline at end of file +c27c51180e88744939ba5af099b6e510968ed2c3 \ No newline at end of file From b59b95a4039633f9799164097c3a6dd74bc445a7 Mon Sep 17 00:00:00 2001 From: shaneh Date: Thu, 4 Nov 2010 21:13:56 +0000 Subject: [PATCH 5/7] Another change for testing on Windows. FossilOrigin-Name: 2625886b1997dc92e7c3669a4f6ccf3560a4dd80 --- manifest | 24 +++++++----------------- manifest.uuid | 2 +- test/pagerfault.test | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/manifest b/manifest index 206dd5813c..de710a3408 100644 --- a/manifest +++ b/manifest @@ -1,8 +1,5 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -C Fix\sthe\smain.mk\smakefile\sto\sinclude\stest_multiplex.c\sfor\stestfixture. -D 2010-11-04T21:03:47 +C Another\schange\sfor\stesting\son\sWindows. +D 2010-11-04T21:13:56 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2c8cefd962eca0147132c7cf9eaa4bb24c656f3f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -575,7 +572,7 @@ F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec F test/pager1.test 07b06b89d50bc38bb118a18b99c7bee645b315de F test/pager2.test 0fbb6b6dc40ce1fecfe758c555a748ad2e9beaa3 F test/pager3.test 3856d9c80839be0668efee1b74811b1b7f7fc95f -F test/pagerfault.test 3cd3537bf2efb4baef26c74878718f4a32926da4 +F test/pagerfault.test 9de4d3e0c59970b4c6cb8dac511fa242f335d8a7 F test/pagerfault2.test 1f79ea40d1133b2683a2f811b00f2399f7ec2401 F test/pageropt.test 8146bf448cf09e87bb1867c2217b921fb5857806 F test/pagesize.test 76aa9f23ecb0741a4ed9d2e16c5fa82671f28efb @@ -888,14 +885,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P dd4dc8a4269e23ffe0e18438690da6077e17cdad -R f3b8f733ce6b1e935135e12bc066b859 -U drh -Z cbbc50b0b1fbc9c52770b191d7e4d95b ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.6 (GNU/Linux) - -iD8DBQFM0x+2oxKgR168RlERAt0NAJ0YYnBOt4BVXCmrJ15SRL6/J21eBwCeOx8T -W8FvV7zDRiGNGHvyFtdeHi8= -=J2pj ------END PGP SIGNATURE----- +P c27c51180e88744939ba5af099b6e510968ed2c3 +R 7402dc628b0a726b1740724f465de7f9 +U shaneh +Z 6af1e958f4b85f78bb9c5a75211b5873 diff --git a/manifest.uuid b/manifest.uuid index 41c1ea25f1..aaca71b7d4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c27c51180e88744939ba5af099b6e510968ed2c3 \ No newline at end of file +2625886b1997dc92e7c3669a4f6ccf3560a4dd80 \ No newline at end of file diff --git a/test/pagerfault.test b/test/pagerfault.test index adea58d500..c5c7d3b33a 100644 --- a/test/pagerfault.test +++ b/test/pagerfault.test @@ -1100,8 +1100,8 @@ do_faultsim_test pagerfault-22 -prep { # PagerRollback() # do_faultsim_test pagerfault-23 -prep { - foreach f [glob -nocomplain test.db*] { file delete -force $f } sqlite3 db :memory: + foreach f [glob -nocomplain test.db*] { file delete -force $f } db eval { ATTACH 'test.db2' AS aux; CREATE TABLE t1(a, b); From 5e41ac34608ef398748a6dee9653b6c2f2481e8d Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 4 Nov 2010 21:14:12 +0000 Subject: [PATCH 6/7] Back out an unintended change to permutations.test. FossilOrigin-Name: 57fe35357dba7ebb382486b916004004b35f8c55 --- manifest | 24 +++++++++++++++++------- manifest.uuid | 2 +- test/permutations.test | 10 ++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/manifest b/manifest index de710a3408..23cc343d3b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C Another\schange\sfor\stesting\son\sWindows. -D 2010-11-04T21:13:56 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C Back\sout\san\sunintended\schange\sto\spermutations.test. +D 2010-11-04T21:14:12 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2c8cefd962eca0147132c7cf9eaa4bb24c656f3f F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -578,7 +581,7 @@ F test/pageropt.test 8146bf448cf09e87bb1867c2217b921fb5857806 F test/pagesize.test 76aa9f23ecb0741a4ed9d2e16c5fa82671f28efb F test/pcache.test 4118a183908ecaed343a06fcef3ba82e87e0129d F test/pcache2.test 0d85f2ab6963aee28c671d4c71bec038c00a1d16 -F test/permutations.test 28d7e1fb31486477d7747508f58fd79f0b6e3a33 +F test/permutations.test 193238b7828759805091ecddd9a0912767f236a4 F test/pragma.test fdfc09067ea104a0c247a1a79d8093b56656f850 F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47 F test/printf.test 05970cde31b1a9f54bd75af60597be75a5c54fea @@ -885,7 +888,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P c27c51180e88744939ba5af099b6e510968ed2c3 -R 7402dc628b0a726b1740724f465de7f9 -U shaneh -Z 6af1e958f4b85f78bb9c5a75211b5873 +P 2625886b1997dc92e7c3669a4f6ccf3560a4dd80 +R ba80a8678c054bde8d19a3f9af46b7a6 +U drh +Z 68b693a3e08d7570b522142ee63f38e7 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQFM0yInoxKgR168RlERAjqLAJsGnSKxOXreiILlp/S3zhtXVgGdWgCeIKmM +Uv+GoGls+jLaQnNG4zcm9ZI= +=5V/P +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index aaca71b7d4..e789b735e5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2625886b1997dc92e7c3669a4f6ccf3560a4dd80 \ No newline at end of file +57fe35357dba7ebb382486b916004004b35f8c55 \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index daa8607dfa..5576f5bf39 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -771,15 +771,9 @@ proc run_tests {name args} { uplevel $options(-initialize) - # uncomment stuff here to skip to a particular test - set skip_to_file "pagerfault.test" - set skip 1 foreach file [lsort $options(-files)] { - if {[file tail $file] == $skip_to_file} { set skip 0 } - if {$skip == 0} { - if {[file tail $file] == $file} { set file [file join $::testdir $file] } - slave_test_file $file - } + if {[file tail $file] == $file} { set file [file join $::testdir $file] } + slave_test_file $file } uplevel $options(-shutdown) From 5af3ebd05b67319e4bbea9be578b3e8f5a803143 Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 5 Nov 2010 00:00:42 +0000 Subject: [PATCH 7/7] Fix the Makefile.in so that it works with the multiplexer VFS. FossilOrigin-Name: 54e2efb6679433e48106247ed6ea0d4c029438b8 --- Makefile.in | 1 + manifest | 18 +++++++++--------- manifest.uuid | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3659e944bd..c9d42c622d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -364,6 +364,7 @@ TESTSRC = \ $(TOP)/src/test_intarray.c \ $(TOP)/src/test_journal.c \ $(TOP)/src/test_malloc.c \ + $(TOP)/src/test_multiplex.c \ $(TOP)/src/test_mutex.c \ $(TOP)/src/test_onefile.c \ $(TOP)/src/test_osinst.c \ diff --git a/manifest b/manifest index 23cc343d3b..a054b50e84 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -C Back\sout\san\sunintended\schange\sto\spermutations.test. -D 2010-11-04T21:14:12 +C Fix\sthe\sMakefile.in\sso\sthat\sit\sworks\swith\sthe\smultiplexer\sVFS. +D 2010-11-05T00:00:42 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f -F Makefile.in 2c8cefd962eca0147132c7cf9eaa4bb24c656f3f +F Makefile.in e7a59672eaeb04408d1fa8501618d7501a3c5e39 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.vxworks c85ec1d8597fe2f7bc225af12ac1666e21379151 F README cd04a36fbc7ea56932a4052d7d0b7f09f27c33d6 @@ -888,14 +888,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 2625886b1997dc92e7c3669a4f6ccf3560a4dd80 -R ba80a8678c054bde8d19a3f9af46b7a6 +P 57fe35357dba7ebb382486b916004004b35f8c55 +R fca1c48d8560f11cfa1d07bdc32e8cdd U drh -Z 68b693a3e08d7570b522142ee63f38e7 +Z ab9bd238c44353ca360ff24c77c3e9fd -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) -iD8DBQFM0yInoxKgR168RlERAjqLAJsGnSKxOXreiILlp/S3zhtXVgGdWgCeIKmM -Uv+GoGls+jLaQnNG4zcm9ZI= -=5V/P +iD8DBQFM00kvoxKgR168RlERAsLGAJ46/bkp8EV92Er1LghqUZG9wo+4YgCgjGl9 +RBoxPM5PzTRFK2P31tRourI= +=LWOS -----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index e789b735e5..a52acb13cd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -57fe35357dba7ebb382486b916004004b35f8c55 \ No newline at end of file +54e2efb6679433e48106247ed6ea0d4c029438b8 \ No newline at end of file