mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
More tests and added support for xDelete in multiplex VFS.
FossilOrigin-Name: f2004b44bfba62a7a2296b161a25aefdf55e035a
This commit is contained in:
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Additional\serror\schecking\sand\stests.
|
C More\stests\sand\sadded\ssupport\sfor\sxDelete\sin\smultiplex\sVFS.
|
||||||
D 2010-11-05T03:58:59
|
D 2010-11-05T17:51:25
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in e7a59672eaeb04408d1fa8501618d7501a3c5e39
|
F Makefile.in e7a59672eaeb04408d1fa8501618d7501a3c5e39
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@ -207,7 +207,7 @@ F src/test_intarray.h 489edb9068bb926583445cb02589344961054207
|
|||||||
F src/test_journal.c 785edd54f963aefb3c1628124170a56697c68c70
|
F src/test_journal.c 785edd54f963aefb3c1628124170a56697c68c70
|
||||||
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
|
F src/test_loadext.c df586c27176e3c2cb2e099c78da67bf14379a56e
|
||||||
F src/test_malloc.c 09a88f0c111201dc4f8c20470aa1b5f611d59200
|
F src/test_malloc.c 09a88f0c111201dc4f8c20470aa1b5f611d59200
|
||||||
F src/test_multiplex.c 197ff9d3b55ea11fbfd73f7840d5d0956a37f49a
|
F src/test_multiplex.c 83eb652fb42f4c0f3536de48ec9d37121fb60c9d
|
||||||
F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3
|
F src/test_mutex.c ce06b59aca168cd8c520b77159a24352a7469bd3
|
||||||
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
|
F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec
|
||||||
F src/test_osinst.c f408c6a181f2fb04c56273afd5c3e1e82f60392c
|
F src/test_osinst.c f408c6a181f2fb04c56273afd5c3e1e82f60392c
|
||||||
@ -559,7 +559,7 @@ F test/misc5.test 45b2e3ed5f79af2b4f38ae362eaf4c49674575bd
|
|||||||
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
F test/misc6.test 953cc693924d88e6117aeba16f46f0bf5abede91
|
||||||
F test/misc7.test c5f4e6a82e04e71820c0f9f64f6733f04c8ae0ae
|
F test/misc7.test c5f4e6a82e04e71820c0f9f64f6733f04c8ae0ae
|
||||||
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
|
F test/misuse.test 30b3a458e5a70c31e74c291937b6c82204c59f33
|
||||||
F test/multiplex.test 201607f360704f2a34a43116e239cf68d5229544
|
F test/multiplex.test ad3710e5ff4781317866b11875691173d2d6a8f7
|
||||||
F test/mutex1.test 5b71777fc127509cd257910c8db799de557a02de
|
F test/mutex1.test 5b71777fc127509cd257910c8db799de557a02de
|
||||||
F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
|
F test/mutex2.test bfeaeac2e73095b2ac32285d2756e3a65e681660
|
||||||
F test/nan.test a44e04df1486fcfb02d32468cbcd3c8e1e433723
|
F test/nan.test a44e04df1486fcfb02d32468cbcd3c8e1e433723
|
||||||
@ -885,7 +885,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||||
P 8ed944ba74566c6241d655a39801ad192c61219a
|
P 1ab9a59237bed6d03b55153a67588486f9adc67b
|
||||||
R 2e87de5f11b0bd307c5994f0595baf10
|
R e3f2efd9b864f5e92369281a6cf12f95
|
||||||
U shaneh
|
U shaneh
|
||||||
Z 00935f175454b7260c72ad18880a1123
|
Z 1f717c7c3b7e6be23615db108e9ab753
|
||||||
|
@ -1 +1 @@
|
|||||||
1ab9a59237bed6d03b55153a67588486f9adc67b
|
f2004b44bfba62a7a2296b161a25aefdf55e035a
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
/************************ Shim Definitions ******************************/
|
/************************ Shim Definitions ******************************/
|
||||||
|
|
||||||
#define SQLITE_MULTIPLEX_CHUNK_SIZE 0x80000000
|
#define SQLITE_MULTIPLEX_CHUNK_SIZE 0x40000000
|
||||||
#define SQLITE_MULTIPLEX_MAX_CHUNKS 32
|
#define SQLITE_MULTIPLEX_MAX_CHUNKS 32
|
||||||
|
|
||||||
/************************ Object Definitions ******************************/
|
/************************ Object Definitions ******************************/
|
||||||
@ -112,6 +112,11 @@ static struct {
|
|||||||
int nChunkSize;
|
int nChunkSize;
|
||||||
int nMaxChunks;
|
int nMaxChunks;
|
||||||
|
|
||||||
|
/* Storage for temp file names. Allocated during
|
||||||
|
** initialization to the max pathname of the underlying VFS.
|
||||||
|
*/
|
||||||
|
char *zName;
|
||||||
|
|
||||||
} gMultiplex;
|
} gMultiplex;
|
||||||
|
|
||||||
/************************* Utility Routines *********************************/
|
/************************* Utility Routines *********************************/
|
||||||
@ -143,11 +148,12 @@ static sqlite3_file *multiplexSubOpen(multiplexConn *pConn, int iChunk, int *rc,
|
|||||||
*rc = SQLITE_OK;
|
*rc = SQLITE_OK;
|
||||||
return pSubOpen;
|
return pSubOpen;
|
||||||
}
|
}
|
||||||
*rc = SQLITE_ERROR;
|
*rc = SQLITE_FULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************* VFS Method Wrappers *****************************/
|
/************************* VFS Method Wrappers *****************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This is the xOpen method used for the "multiplex" VFS.
|
** This is the xOpen method used for the "multiplex" VFS.
|
||||||
**
|
**
|
||||||
@ -172,13 +178,6 @@ static int multiplexOpen(
|
|||||||
|
|
||||||
UNUSED_PARAMETER(pVfs);
|
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
|
/* We need to create a group structure and manage
|
||||||
** access to this group of files.
|
** access to this group of files.
|
||||||
*/
|
*/
|
||||||
@ -220,6 +219,43 @@ static int multiplexOpen(
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** This is the xDelete method used for the "multiplex" VFS.
|
||||||
|
** It attempts to delete the filename specified, as well
|
||||||
|
** as addiitional files with the "-####" extension.
|
||||||
|
*/
|
||||||
|
static int multiplexDelete(
|
||||||
|
sqlite3_vfs *pVfs, /* The multiplex VFS */
|
||||||
|
const char *zName, /* Name of file to delete */
|
||||||
|
int syncDir
|
||||||
|
){
|
||||||
|
sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs; /* Real VFS */
|
||||||
|
int rc = SQLITE_OK;
|
||||||
|
int nName = sqlite3Strlen30(zName);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
UNUSED_PARAMETER(pVfs);
|
||||||
|
|
||||||
|
multiplexEnter();
|
||||||
|
memcpy(gMultiplex.zName, zName, nName+1);
|
||||||
|
for(i=0; i<gMultiplex.nMaxChunks; i++){
|
||||||
|
int rc2;
|
||||||
|
int exists = 0;
|
||||||
|
if( i ) sqlite3_snprintf(nName+6, gMultiplex.zName+nName, "-%04d", i);
|
||||||
|
rc2 = pOrigVfs->xAccess(pOrigVfs, gMultiplex.zName, SQLITE_ACCESS_EXISTS, &exists);
|
||||||
|
if( rc2==SQLITE_OK && exists){
|
||||||
|
/* if it exists, delete it */
|
||||||
|
rc2 = pOrigVfs->xDelete(pOrigVfs, gMultiplex.zName, syncDir);
|
||||||
|
if( rc2!=SQLITE_OK ) rc = rc2;
|
||||||
|
}else{
|
||||||
|
/* stop at first "gap" */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
multiplexLeave();
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
/************************ I/O Method Wrappers *******************************/
|
/************************ I/O Method Wrappers *******************************/
|
||||||
|
|
||||||
/* xClose requests get passed through to the original VFS.
|
/* xClose requests get passed through to the original VFS.
|
||||||
@ -233,6 +269,7 @@ static int multiplexClose(sqlite3_file *pConn){
|
|||||||
int rc = SQLITE_OK;
|
int rc = SQLITE_OK;
|
||||||
int i;
|
int i;
|
||||||
multiplexEnter();
|
multiplexEnter();
|
||||||
|
/* close any open handles */
|
||||||
for(i=0; i<gMultiplex.nMaxChunks; i++){
|
for(i=0; i<gMultiplex.nMaxChunks; i++){
|
||||||
if( pGroup->bOpen[i] ){
|
if( pGroup->bOpen[i] ){
|
||||||
sqlite3_file *pSubOpen = pGroup->pReal[i];
|
sqlite3_file *pSubOpen = pGroup->pReal[i];
|
||||||
@ -241,6 +278,7 @@ static int multiplexClose(sqlite3_file *pConn){
|
|||||||
pGroup->bOpen[i] = 0;
|
pGroup->bOpen[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* remove from linked list */
|
||||||
if( pGroup->pNext ) pGroup->pNext->pPrev = pGroup->pPrev;
|
if( pGroup->pNext ) pGroup->pNext->pPrev = pGroup->pPrev;
|
||||||
if( pGroup->pPrev ){
|
if( pGroup->pPrev ){
|
||||||
pGroup->pPrev->pNext = pGroup->pNext;
|
pGroup->pPrev->pNext = pGroup->pNext;
|
||||||
@ -576,6 +614,11 @@ int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault){
|
|||||||
if( !gMultiplex.pMutex ){
|
if( !gMultiplex.pMutex ){
|
||||||
return SQLITE_NOMEM;
|
return SQLITE_NOMEM;
|
||||||
}
|
}
|
||||||
|
gMultiplex.zName = sqlite3_malloc(pOrigVfs->mxPathname);
|
||||||
|
if( !gMultiplex.zName ){
|
||||||
|
sqlite3_mutex_free(gMultiplex.pMutex);
|
||||||
|
return SQLITE_NOMEM;
|
||||||
|
}
|
||||||
gMultiplex.nChunkSize = SQLITE_MULTIPLEX_CHUNK_SIZE;
|
gMultiplex.nChunkSize = SQLITE_MULTIPLEX_CHUNK_SIZE;
|
||||||
gMultiplex.nMaxChunks = SQLITE_MULTIPLEX_MAX_CHUNKS;
|
gMultiplex.nMaxChunks = SQLITE_MULTIPLEX_MAX_CHUNKS;
|
||||||
gMultiplex.pGroups = NULL;
|
gMultiplex.pGroups = NULL;
|
||||||
@ -585,6 +628,7 @@ int sqlite3_multiplex_initialize(const char *zOrigVfsName, int makeDefault){
|
|||||||
gMultiplex.sThisVfs.szOsFile += sizeof(multiplexConn);
|
gMultiplex.sThisVfs.szOsFile += sizeof(multiplexConn);
|
||||||
gMultiplex.sThisVfs.zName = "multiplex";
|
gMultiplex.sThisVfs.zName = "multiplex";
|
||||||
gMultiplex.sThisVfs.xOpen = multiplexOpen;
|
gMultiplex.sThisVfs.xOpen = multiplexOpen;
|
||||||
|
gMultiplex.sThisVfs.xDelete = multiplexDelete;
|
||||||
gMultiplex.sIoMethodsV1.iVersion = 1;
|
gMultiplex.sIoMethodsV1.iVersion = 1;
|
||||||
gMultiplex.sIoMethodsV1.xClose = multiplexClose;
|
gMultiplex.sIoMethodsV1.xClose = multiplexClose;
|
||||||
gMultiplex.sIoMethodsV1.xRead = multiplexRead;
|
gMultiplex.sIoMethodsV1.xRead = multiplexRead;
|
||||||
@ -621,6 +665,7 @@ int sqlite3_multiplex_shutdown(void){
|
|||||||
if( gMultiplex.isInitialized==0 ) return SQLITE_MISUSE;
|
if( gMultiplex.isInitialized==0 ) return SQLITE_MISUSE;
|
||||||
if( gMultiplex.pGroups ) return SQLITE_MISUSE;
|
if( gMultiplex.pGroups ) return SQLITE_MISUSE;
|
||||||
gMultiplex.isInitialized = 0;
|
gMultiplex.isInitialized = 0;
|
||||||
|
sqlite3_free(gMultiplex.zName);
|
||||||
sqlite3_mutex_free(gMultiplex.pMutex);
|
sqlite3_mutex_free(gMultiplex.pMutex);
|
||||||
sqlite3_vfs_unregister(&gMultiplex.sThisVfs);
|
sqlite3_vfs_unregister(&gMultiplex.sThisVfs);
|
||||||
memset(&gMultiplex, 0, sizeof(gMultiplex));
|
memset(&gMultiplex, 0, sizeof(gMultiplex));
|
||||||
|
@ -14,13 +14,27 @@ set testdir [file dirname $argv0]
|
|||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
source $testdir/malloc_common.tcl
|
source $testdir/malloc_common.tcl
|
||||||
|
|
||||||
|
set g_chunk_size 2147483648
|
||||||
|
set g_max_chunks 32
|
||||||
|
|
||||||
|
proc multiplex_set {chunk_size max_chunks} {
|
||||||
|
global g_chunk_size
|
||||||
|
global g_max_chunks
|
||||||
|
set g_chunk_size $chunk_size
|
||||||
|
set g_max_chunks $max_chunks
|
||||||
|
sqlite3_multiplex_set $chunk_size $max_chunks
|
||||||
|
}
|
||||||
|
|
||||||
proc multiplex_delete {name} {
|
proc multiplex_delete {name} {
|
||||||
file delete -force $name
|
global g_max_chunks
|
||||||
file delete -force $name-journal
|
forcedelete $name
|
||||||
file delete -force $name-wal
|
forcedelete $name-journal
|
||||||
for {set i 1} {$i<=15} {incr i} {
|
forcedelete $name-wal
|
||||||
file delete -force $name-000$i
|
for {set i 1} {$i<$g_max_chunks} {incr i} {
|
||||||
file delete -force $name-00$i
|
set num [format "%04d" $i]
|
||||||
|
forcedelete $name-$num
|
||||||
|
forcedelete $name-journal-$num
|
||||||
|
forcedelete $name-wal-$num
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,11 +54,11 @@ do_test multiplex-1.7 { sqlite3_multiplex_initialize "" 1 } {SQLITE_OK}
|
|||||||
do_test multiplex-1.8 { sqlite3_multiplex_shutdown } {SQLITE_OK}
|
do_test multiplex-1.8 { sqlite3_multiplex_shutdown } {SQLITE_OK}
|
||||||
|
|
||||||
do_test multiplex-1.9 { sqlite3_multiplex_initialize "" 1 } {SQLITE_OK}
|
do_test multiplex-1.9 { sqlite3_multiplex_initialize "" 1 } {SQLITE_OK}
|
||||||
do_test multiplex-1.10.1 { sqlite3_multiplex_set 0x8000 16 } {SQLITE_OK}
|
do_test multiplex-1.10.1 { multiplex_set 32768 16 } {SQLITE_OK}
|
||||||
do_test multiplex-1.10.2 { sqlite3_multiplex_set 0x8000 -1 } {SQLITE_MISUSE}
|
do_test multiplex-1.10.2 { multiplex_set 32768 -1 } {SQLITE_MISUSE}
|
||||||
do_test multiplex-1.10.3 { sqlite3_multiplex_set -1 16 } {SQLITE_MISUSE}
|
do_test multiplex-1.10.3 { multiplex_set -1 16 } {SQLITE_MISUSE}
|
||||||
do_test multiplex-1.10.4 { sqlite3_multiplex_set 31 16 } {SQLITE_MISUSE}
|
do_test multiplex-1.10.4 { multiplex_set 31 16 } {SQLITE_MISUSE}
|
||||||
do_test multiplex-1.10.5 { sqlite3_multiplex_set 0x8000 33 } {SQLITE_MISUSE}
|
do_test multiplex-1.10.5 { multiplex_set 32768 33 } {SQLITE_MISUSE}
|
||||||
do_test multiplex-1.11 { sqlite3_multiplex_shutdown } {SQLITE_OK}
|
do_test multiplex-1.11 { sqlite3_multiplex_shutdown } {SQLITE_OK}
|
||||||
|
|
||||||
|
|
||||||
@ -63,10 +77,12 @@ do_test multiplex-1.11 { sqlite3_multiplex_shutdown } {SQLITE_OK}
|
|||||||
# afterwards. Then close the database and successfully shut
|
# afterwards. Then close the database and successfully shut
|
||||||
# down the multiplex system.
|
# down the multiplex system.
|
||||||
#
|
#
|
||||||
# multiplex-2.5.*: More reading/writing with small chunk size.
|
# multiplex-2.5.*: More reading/writing.
|
||||||
|
#
|
||||||
|
# multiplex-2.6.*: More reading/writing with varying small chunk sizes.
|
||||||
|
|
||||||
sqlite3_multiplex_initialize "" 1
|
sqlite3_multiplex_initialize "" 1
|
||||||
sqlite3_multiplex_set 0x8000 16
|
multiplex_set 32768 16
|
||||||
|
|
||||||
do_test multiplex-2.1.2 {
|
do_test multiplex-2.1.2 {
|
||||||
sqlite3 db test.db
|
sqlite3 db test.db
|
||||||
@ -112,7 +128,7 @@ do_test multiplex-2.4.99 {
|
|||||||
do_test multiplex-2.5.1 {
|
do_test multiplex-2.5.1 {
|
||||||
multiplex_delete test.db
|
multiplex_delete test.db
|
||||||
sqlite3_multiplex_initialize "" 1
|
sqlite3_multiplex_initialize "" 1
|
||||||
sqlite3_multiplex_set 0x1000 16
|
multiplex_set 4096 16
|
||||||
} {SQLITE_OK}
|
} {SQLITE_OK}
|
||||||
|
|
||||||
do_test multiplex-2.5.2 {
|
do_test multiplex-2.5.2 {
|
||||||
@ -155,11 +171,57 @@ do_test multiplex-2.5.8 {
|
|||||||
db eval {SELECT a,length(b) FROM t1 WHERE a=4}
|
db eval {SELECT a,length(b) FROM t1 WHERE a=4}
|
||||||
} {4 4000}
|
} {4 4000}
|
||||||
|
|
||||||
|
do_test multiplex-2.5.9 { file size test.db } [list $g_chunk_size]
|
||||||
|
do_test multiplex-2.5.10 { file size test.db-0001 } [list $g_chunk_size]
|
||||||
|
|
||||||
do_test multiplex-2.5.99 {
|
do_test multiplex-2.5.99 {
|
||||||
db close
|
db close
|
||||||
sqlite3_multiplex_shutdown
|
sqlite3_multiplex_shutdown
|
||||||
} {SQLITE_OK}
|
} {SQLITE_OK}
|
||||||
|
|
||||||
|
|
||||||
|
for {set sz 151} {$sz<8000} {set sz [expr $sz+419]} {
|
||||||
|
|
||||||
|
do_test multiplex-2.6.1.$sz {
|
||||||
|
multiplex_delete test.db
|
||||||
|
sqlite3_multiplex_initialize "" 1
|
||||||
|
multiplex_set $sz 32
|
||||||
|
} {SQLITE_OK}
|
||||||
|
|
||||||
|
do_test multiplex-2.6.2.$sz {
|
||||||
|
sqlite3 db test.db
|
||||||
|
execsql {
|
||||||
|
PRAGMA page_size = 1024;
|
||||||
|
PRAGMA journal_mode = delete;
|
||||||
|
PRAGMA auto_vacuum = off;
|
||||||
|
CREATE TABLE t1(a PRIMARY KEY, b);
|
||||||
|
}
|
||||||
|
} {delete}
|
||||||
|
|
||||||
|
do_test multiplex-2.6.3.$sz {
|
||||||
|
execsql {
|
||||||
|
INSERT INTO t1 VALUES(1, 'one');
|
||||||
|
INSERT INTO t1 VALUES(2, randomblob($g_chunk_size));
|
||||||
|
}
|
||||||
|
} {}
|
||||||
|
|
||||||
|
do_test multiplex-2.6.4.$sz {
|
||||||
|
db eval {SELECT b FROM t1 WHERE a=1}
|
||||||
|
} {one}
|
||||||
|
|
||||||
|
do_test multiplex-2.6.5.$sz {
|
||||||
|
db eval {SELECT length(b) FROM t1 WHERE a=2}
|
||||||
|
} [list $g_chunk_size]
|
||||||
|
|
||||||
|
do_test multiplex-2.6.6.$sz { file size test.db } [list $g_chunk_size]
|
||||||
|
|
||||||
|
do_test multiplex-2.6.99.$sz {
|
||||||
|
db close
|
||||||
|
sqlite3_multiplex_shutdown
|
||||||
|
} {SQLITE_OK}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# Try some tests with more than one connection to a database file. Still
|
# Try some tests with more than one connection to a database file. Still
|
||||||
# in rollback mode.
|
# in rollback mode.
|
||||||
@ -172,7 +234,7 @@ do_test multiplex-2.5.99 {
|
|||||||
do_test multiplex-3.1.1 {
|
do_test multiplex-3.1.1 {
|
||||||
multiplex_delete test.db
|
multiplex_delete test.db
|
||||||
sqlite3_multiplex_initialize "" 1
|
sqlite3_multiplex_initialize "" 1
|
||||||
sqlite3_multiplex_set 0x8000 16
|
multiplex_set 32768 16
|
||||||
} {SQLITE_OK}
|
} {SQLITE_OK}
|
||||||
do_test multiplex-3.1.2 {
|
do_test multiplex-3.1.2 {
|
||||||
sqlite3 db test.db
|
sqlite3 db test.db
|
||||||
@ -258,7 +320,7 @@ do_test multiplex-3.2.X {
|
|||||||
#
|
#
|
||||||
|
|
||||||
sqlite3_multiplex_initialize "" 1
|
sqlite3_multiplex_initialize "" 1
|
||||||
sqlite3_multiplex_set 0x8000 16
|
multiplex_set 32768 16
|
||||||
|
|
||||||
# Return a list of all currently defined multiplexs.
|
# Return a list of all currently defined multiplexs.
|
||||||
proc multiplex_list {} {
|
proc multiplex_list {} {
|
||||||
@ -320,7 +382,7 @@ do_test multiplex-4.1.12 {
|
|||||||
#
|
#
|
||||||
|
|
||||||
sqlite3_multiplex_initialize "" 1
|
sqlite3_multiplex_initialize "" 1
|
||||||
sqlite3_multiplex_set 0x8000 16
|
multiplex_set 32768 16
|
||||||
|
|
||||||
do_faultsim_test multiplex-5.1 -prep {
|
do_faultsim_test multiplex-5.1 -prep {
|
||||||
catch {db close}
|
catch {db close}
|
||||||
@ -335,6 +397,7 @@ do_faultsim_test multiplex-5.2 -prep {
|
|||||||
|
|
||||||
catch { db close }
|
catch { db close }
|
||||||
multiplex_delete test.db
|
multiplex_delete test.db
|
||||||
|
multiplex_delete test2.db
|
||||||
|
|
||||||
do_test multiplex-5.3.prep {
|
do_test multiplex-5.3.prep {
|
||||||
sqlite3 db test.db
|
sqlite3 db test.db
|
||||||
@ -358,12 +421,13 @@ do_test multiplex-5.4.1 {
|
|||||||
file mkdir test.db
|
file mkdir test.db
|
||||||
list [catch { sqlite3 db test.db } msg] $msg
|
list [catch { sqlite3 db test.db } msg] $msg
|
||||||
} {1 {unable to open database file}}
|
} {1 {unable to open database file}}
|
||||||
|
catch { file delete test.db }
|
||||||
|
|
||||||
do_faultsim_test multiplex-5.5 -prep {
|
do_faultsim_test multiplex-5.5 -prep {
|
||||||
catch { sqlite3_multiplex_shutdown }
|
catch { sqlite3_multiplex_shutdown }
|
||||||
} -body {
|
} -body {
|
||||||
sqlite3_multiplex_initialize "" 1
|
sqlite3_multiplex_initialize "" 1
|
||||||
sqlite3_multiplex_set 0x8000 16
|
multiplex_set 32768 16
|
||||||
}
|
}
|
||||||
|
|
||||||
catch { sqlite3_multiplex_shutdown }
|
catch { sqlite3_multiplex_shutdown }
|
||||||
|
Reference in New Issue
Block a user