1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

The quick test runs again with a handfull of errors after adding the

mutex locks to btree, the VFS registration interfaces, and FTS3. (CVS 4254)

FossilOrigin-Name: 6cf725d212d468cbd7c7cbc22ca5ab13f1d77939
This commit is contained in:
drh
2007-08-20 23:50:24 +00:00
parent d677b3d688
commit a2451e2255
5 changed files with 40 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
C Work\stoward\smultithreading\ssupport.\s\sCurrently\scrashes\squickly\son\sa\stest.\s(CVS\s4253) C The\squick\stest\sruns\sagain\swith\sa\shandfull\sof\serrors\safter\sadding\sthe\nmutex\slocks\sto\sbtree,\sthe\sVFS\sregistration\sinterfaces,\sand\sFTS3.\s(CVS\s4254)
D 2007-08-20T22:48:42 D 2007-08-20T23:50:25
F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -80,7 +80,7 @@ F src/alter.c f0aac0060ae8102e58f210b44d35b53438d53173
F src/analyze.c a14237d869c6bea0846493b59317e4097e81a0b6 F src/analyze.c a14237d869c6bea0846493b59317e4097e81a0b6
F src/attach.c a52225c75b107be8c5bc144a2b6d20201be3f8f8 F src/attach.c a52225c75b107be8c5bc144a2b6d20201be3f8f8
F src/auth.c 5ea90bc93dfea46e9fe4bf531e14c7cd98219ecb F src/auth.c 5ea90bc93dfea46e9fe4bf531e14c7cd98219ecb
F src/btree.c ae710a86a5ee2f27fbcba34033e4f048bd97cde9 F src/btree.c 9460e9ad37b39f4d397b6207f25814e8dd4db6e9
F src/btree.h 525105564c87111922412368f2e4301c36e74ac1 F src/btree.h 525105564c87111922412368f2e4301c36e74ac1
F src/btreeInt.h e93edf57832278138b98cf60cbc54241103c6988 F src/btreeInt.h e93edf57832278138b98cf60cbc54241103c6988
F src/build.c add67be992307b4b11849a6611bfd3352aacde92 F src/build.c add67be992307b4b11849a6611bfd3352aacde92
@@ -132,7 +132,7 @@ F src/table.c c725e47f6f3092b9a7b569fc58e408e2173ee008
F src/tclsqlite.c 0606c4f31711492eb4d7480a981eebb80914f3d9 F src/tclsqlite.c 0606c4f31711492eb4d7480a981eebb80914f3d9
F src/test1.c 6ae17d70dac0f14ab632f66c026a44fb0c71f22e F src/test1.c 6ae17d70dac0f14ab632f66c026a44fb0c71f22e
F src/test2.c 4506b6635e193a19a9bccdbe366ff4aed09cbe79 F src/test2.c 4506b6635e193a19a9bccdbe366ff4aed09cbe79
F src/test3.c b87e8fcce45e1d3153aae9f04236076b7707a714 F src/test3.c b6d6a452a394c690395b1d7155e7bf00fb99a12d
F src/test4.c 1f4d2ed89867bac187d49ed8004f121592987d3e F src/test4.c 1f4d2ed89867bac187d49ed8004f121592987d3e
F src/test5.c 7bc8a87c2b6fd076ec2ca9972946e71a367883ad F src/test5.c 7bc8a87c2b6fd076ec2ca9972946e71a367883ad
F src/test6.c b0090b4826d5e06df2ff2d5acaddf3f8f708fcd2 F src/test6.c b0090b4826d5e06df2ff2d5acaddf3f8f708fcd2
@@ -142,7 +142,7 @@ F src/test9.c c0f38f7795cc51d37db6c63874d90f40f10d0f0e
F src/test_async.c ba48913e4bab43b149747d3bdd3b75b1f66658ec F src/test_async.c ba48913e4bab43b149747d3bdd3b75b1f66658ec
F src/test_autoext.c 855157d97aa28cf84233847548bfacda21807436 F src/test_autoext.c 855157d97aa28cf84233847548bfacda21807436
F src/test_btree.c c1308ba0b88ab577fa56c9e493a09829dfcded9c F src/test_btree.c c1308ba0b88ab577fa56c9e493a09829dfcded9c
F src/test_config.c ddced28aedfa324292005d991d74b595d76a838a F src/test_config.c 6e2cad5669f13b38b8e02850157448a757f21df7
F src/test_hexio.c 82916f918687502658f02533b519c38cb180db6d F src/test_hexio.c 82916f918687502658f02533b519c38cb180db6d
F src/test_loadext.c 22065d601a18878e5542191001f0eaa5d77c0ed8 F src/test_loadext.c 22065d601a18878e5542191001f0eaa5d77c0ed8
F src/test_malloc.c d9ba6be85f9c4a439b19f6e0a72d91c369d72c63 F src/test_malloc.c d9ba6be85f9c4a439b19f6e0a72d91c369d72c63
@@ -557,7 +557,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 709f2aa18a4802a7ca6638c00b2b99440b4a3191 P 1315bd8e125602275fb718780f9b2730bd37f6ab
R dff2f29b0cfe4e6e9309aeb129fa4ba9 R d4fae6ff2f91391abff6a85b93359df7
U drh U drh
Z b2675de4c3469ebcd0e4f20229838975 Z bdcd45a572300c8ecdfe8272f9cd3707

View File

@@ -1 +1 @@
1315bd8e125602275fb718780f9b2730bd37f6ab 6cf725d212d468cbd7c7cbc22ca5ab13f1d77939

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give. ** May you share freely, never taking more than you give.
** **
************************************************************************* *************************************************************************
** $Id: btree.c,v 1.403 2007/08/20 22:48:42 drh Exp $ ** $Id: btree.c,v 1.404 2007/08/20 23:50:25 drh Exp $
** **
** This file implements a external (disk-based) database using BTrees. ** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information. ** See the header comment on "btreeInt.h" for additional information.
@@ -1050,9 +1050,9 @@ static void pageDestructor(DbPage *pData, int pageSize){
MemPage *pPage; MemPage *pPage;
assert( (pageSize & 7)==0 ); assert( (pageSize & 7)==0 );
pPage = (MemPage *)sqlite3PagerGetExtra(pData); pPage = (MemPage *)sqlite3PagerGetExtra(pData);
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
if( pPage->pParent ){ if( pPage->pParent ){
MemPage *pParent = pPage->pParent; MemPage *pParent = pPage->pParent;
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
pPage->pParent = 0; pPage->pParent = 0;
releasePage(pParent); releasePage(pParent);
} }
@@ -1071,8 +1071,8 @@ static void pageReinit(DbPage *pData, int pageSize){
MemPage *pPage; MemPage *pPage;
assert( (pageSize & 7)==0 ); assert( (pageSize & 7)==0 );
pPage = (MemPage *)sqlite3PagerGetExtra(pData); pPage = (MemPage *)sqlite3PagerGetExtra(pData);
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
if( pPage->isInit ){ if( pPage->isInit ){
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
pPage->isInit = 0; pPage->isInit = 0;
sqlite3BtreeInitPage(pPage, pPage->pParent); sqlite3BtreeInitPage(pPage, pPage->pParent);
} }

View File

@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated ** is not included in the SQLite library. It is used for automated
** testing of the SQLite library. ** testing of the SQLite library.
** **
** $Id: test3.c,v 1.78 2007/08/16 11:36:15 danielk1977 Exp $ ** $Id: test3.c,v 1.79 2007/08/20 23:50:25 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "pager.h" #include "pager.h"
@@ -48,6 +48,13 @@ static char *errorName(int rc){
return zName; return zName;
} }
/*
** A bogus sqlite3 connection structure for use in the btree
** tests.
*/
static sqlite3 sDb;
static int nRefSqlite3 = 0;
/* /*
** Usage: btree_open FILENAME NCACHE FLAGS ** Usage: btree_open FILENAME NCACHE FLAGS
** **
@@ -69,7 +76,12 @@ static int btree_open(
} }
if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR; if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
if( Tcl_GetInt(interp, argv[3], &flags) ) return TCL_ERROR; if( Tcl_GetInt(interp, argv[3], &flags) ) return TCL_ERROR;
rc = sqlite3BtreeOpen(argv[1], 0, &pBt, flags); nRefSqlite3++;
if( nRefSqlite3==1 ){
sDb.pVfs = sqlite3_vfs_find(0);
sDb.mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_RECURSIVE);
}
rc = sqlite3BtreeOpen(argv[1], &sDb, &pBt, flags);
if( rc!=SQLITE_OK ){ if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0); Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR; return TCL_ERROR;
@@ -104,6 +116,13 @@ static int btree_close(
Tcl_AppendResult(interp, errorName(rc), 0); Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR; return TCL_ERROR;
} }
nRefSqlite3--;
if( nRefSqlite3==0 ){
sqlite3_mutex_free(sDb.mutex);
sDb.mutex = 0;
sqlite3_vfs_release(sDb.pVfs);
sDb.pVfs = 0;
}
return TCL_OK; return TCL_OK;
} }

View File

@@ -16,7 +16,7 @@
** The focus of this file is providing the TCL testing layer ** The focus of this file is providing the TCL testing layer
** access to compile-time constants. ** access to compile-time constants.
** **
** $Id: test_config.c,v 1.9 2007/08/20 22:48:43 drh Exp $ ** $Id: test_config.c,v 1.10 2007/08/20 23:50:25 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "tcl.h" #include "tcl.h"
@@ -197,6 +197,12 @@ static void set_options(Tcl_Interp *interp){
Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "sqlite_options", "fts2", "0", TCL_GLOBAL_ONLY);
#endif #endif
#ifdef SQLITE_ENABLE_FTS3
Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY);
#else
Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY);
#endif
#ifdef SQLITE_OMIT_GLOBALRECOVER #ifdef SQLITE_OMIT_GLOBALRECOVER
Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp, "sqlite_options", "globalrecover", "0", TCL_GLOBAL_ONLY);
#else #else