-C Make\ssure\sleft-join\smarkings\sare\stransferred\sto\sthe\svirtual\sscalar\nsubexpressions\swhen\sdecomposing\sa\svector\scomparison\sin\sthe\sON\sclause\sof\na\sLEFT\sJOIN.\nFix\sfor\sticket\s[fef4bb4bd9185ec8f].
-D 2016-10-27T01:02:20.511
+C Remove\sthe\smutex\sfrom\stest_multiplex.c.
+D 2016-10-27T14:51:02.086
F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc 5151cc64c4c05f3455f4f692ad11410a810d937f
F src/test_journal.c d3b83f2bcb7792c709e57abddc456a2b1818643a
F src/test_loadext.c 337056bae59f80b9eb00ba82088b39d0f4fe6dfd
F src/test_malloc.c c05f6c40bd6c8bfe5f1718212f81fd5687f91766
-F src/test_multiplex.c 7c5b218d855cd0505a43185d55283b3fc257c8da
+F src/test_multiplex.c e054459f7633f3ff8ce1245da724f9a8be189e4e
F src/test_multiplex.h 5436d03f2d0501d04f3ed50a75819e190495b635
F src/test_mutex.c 7f4337ba23ee6b1d2ec81c189653608cb069926a
F src/test_onefile.c 416f87a28d6d673352d33fc4b1c7d39db878e50f
F test/mmap3.test b3c297e78e6a8520aafcc1a8f140535594c9086e
F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93
F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
-F test/multiplex.test efd015ca0b5b4a57dc9535b8feb1273eebeadb60
+F test/multiplex.test dc0d67b66f84b484a83cb8bbdf3f0a7f49562ccd
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
F test/multiplex3.test d228f59eac91839a977eac19f21d053f03e4d101
F test/multiplex4.test e8ae4c4bd70606a5727743241f13b5701990abe4
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P c23f5ef337533c1ec6e3ba78a2910352181cc9ee
-R 724eaf97bc578ade21f74a2fb4242a1f
-U drh
-Z c2d38a18abbe8465fdc3725d309eaa8d
+P 619f5cc71774a37648e185c8502d7af14eb09b7f
+R 93e0c879ea55a634df6077f40936fbef
+U dan
+Z 9550a31672ece71cb80aa7996bb9624a
#define MAX_PAGE_SIZE 0x10000
#define DEFAULT_SECTOR_SIZE 0x1000
-/*
-** For a build without mutexes, no-op the mutex calls.
-*/
-#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE==0
-#define sqlite3_mutex_alloc(X) ((sqlite3_mutex*)8)
-#define sqlite3_mutex_free(X)
-#define sqlite3_mutex_enter(X)
-#define sqlite3_mutex_try(X) SQLITE_OK
-#define sqlite3_mutex_leave(X)
-#define sqlite3_mutex_held(X) ((void)(X),1)
-#define sqlite3_mutex_notheld(X) ((void)(X),1)
-#endif /* SQLITE_THREADSAFE==0 */
-
/* Maximum chunk number */
#define MX_CHUNK_NUMBER 299
unsigned int szChunk; /* Chunk size used for this group */
unsigned char bEnabled; /* TRUE to use Multiplex VFS for this file */
unsigned char bTruncate; /* TRUE to enable truncation of databases */
- multiplexGroup *pNext, *pPrev; /* Doubly linked list of all group objects */
};
/*
/* True when this shim has been initialized.
*/
int isInitialized;
-
- /* For run-time access any of the other global data structures in this
- ** shim, the following mutex must be held. In practice, all this mutex
- ** protects is add/remove operations to/from the linked list of group objects
- ** starting at pGroups below. More specifically, it protects the value of
- ** pGroups itself, and the pNext/pPrev fields of each multiplexGroup
- ** structure. */
- sqlite3_mutex *pMutex;
-
- /* List of multiplexGroup objects.
- */
- multiplexGroup *pGroups;
} 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); }
-
/*
** Compute a string length that is limited to what can be stored in
** lower 30 bits of a 32-bit signed integer.
/* We need to create a group structure and manage
** access to this group of files.
*/
- multiplexEnter();
pMultiplexOpen = (multiplexConn*)pConn;
if( rc==SQLITE_OK ){
}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{
multiplexFreeComponents(pGroup);
sqlite3_free(pGroup);
}
}
- multiplexLeave();
sqlite3_free(zToFree);
return rc;
}
multiplexConn *p = (multiplexConn*)pConn;
multiplexGroup *pGroup = p->pGroup;
int rc = SQLITE_OK;
- multiplexEnter();
multiplexFreeComponents(pGroup);
- /* remove from linked list */
- 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;
}
multiplexConn *p = (multiplexConn*)pConn;
multiplexGroup *pGroup = p->pGroup;
int rc = SQLITE_OK;
- multiplexEnter();
if( !pGroup->bEnabled ){
sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL, 0);
if( pSubOpen==0 ){
}
if( rc ) rc = SQLITE_IOERR_TRUNCATE;
}
- multiplexLeave();
return rc;
}
multiplexGroup *pGroup = p->pGroup;
int rc = SQLITE_OK;
int i;
- multiplexEnter();
for(i=0; i<pGroup->nReal; i++){
sqlite3_file *pSubOpen = pGroup->aReal[i].p;
if( pSubOpen ){
if( rc2!=SQLITE_OK ) rc = rc2;
}
}
- multiplexLeave();
return rc;
}
multiplexGroup *pGroup = p->pGroup;
int rc = SQLITE_OK;
int i;
- multiplexEnter();
if( !pGroup->bEnabled ){
sqlite3_file *pSubOpen = multiplexSubOpen(pGroup, 0, &rc, NULL, 0);
if( pSubOpen==0 ){
*pSize = i*(sqlite3_int64)pGroup->szChunk + sz;
}
}
- multiplexLeave();
return rc;
}
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.pGroups = NULL;
gMultiplex.isInitialized = 1;
gMultiplex.pOrigVfs = pOrigVfs;
gMultiplex.sThisVfs = *pOrigVfs;
int sqlite3_multiplex_shutdown(int eForce){
int rc = SQLITE_OK;
if( gMultiplex.isInitialized==0 ) return SQLITE_MISUSE;
- if( gMultiplex.pGroups ){
- sqlite3_log(SQLITE_MISUSE, "sqlite3_multiplex_shutdown() called "
- "while database connections are still open");
- if( !eForce ) return SQLITE_MISUSE;
- rc = SQLITE_MISUSE;
- }
gMultiplex.isInitialized = 0;
- sqlite3_mutex_free(gMultiplex.pMutex);
sqlite3_vfs_unregister(&gMultiplex.sThisVfs);
memset(&gMultiplex, 0, sizeof(gMultiplex));
return rc;
return TCL_OK;
}
-/*
-** tclcmd: sqlite3_multiplex_dump
-*/
-static int SQLITE_TCLAPI 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();
-
- if( pGroup->zName ){
- pGroup->zName[pGroup->nName] = '\0';
- Tcl_ListObjAppendElement(interp, pGroupTerm,
- Tcl_NewStringObj(pGroup->zName, -1));
- }else{
- Tcl_ListObjAppendElement(interp, pGroupTerm, Tcl_NewObj());
- }
- 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; i<pGroup->nReal; i++){
- if( pGroup->aReal[i].p!=0 ) nChunks++;
- }
- Tcl_ListObjAppendElement(interp, pGroupTerm,
- Tcl_NewIntObj(nChunks));
-
- Tcl_ListObjAppendElement(interp, pGroupTerm,
- Tcl_NewIntObj(pGroup->szChunk));
- Tcl_ListObjAppendElement(interp, pGroupTerm,
- Tcl_NewIntObj(pGroup->nReal));
-
- Tcl_ListObjAppendElement(interp, pResult, pGroupTerm);
- }
- multiplexLeave();
- Tcl_SetObjResult(interp, pResult);
- return TCL_OK;
-}
-
/*
** Tclcmd: test_multiplex_control HANDLE DBNAME SUB-COMMAND ?INT-VALUE?
*/
} aCmd[] = {
{ "sqlite3_multiplex_initialize", test_multiplex_initialize },
{ "sqlite3_multiplex_shutdown", test_multiplex_shutdown },
- { "sqlite3_multiplex_dump", test_multiplex_dump },
{ "sqlite3_multiplex_control", test_multiplex_control },
};
int i;