Get the quick.test script running with SQLITE_THREADSAFE enabled. (CVS 4269)

FossilOrigin-Name: 1f28b7e47bba221c14a10a37e7425c9975bb2312
This commit is contained in:
drh 2007-08-22 11:41:18 +00:00
parent c7b6017c8a
commit cab5ed7a57
6 changed files with 35 additions and 39 deletions

View File

@ -1,5 +1,5 @@
C Add\scode\sfor\sthe\satomic-write\soptimisation.\sDisabled\sby\sdefault.\s(CVS\s4268) C Get\sthe\squick.test\sscript\srunning\swith\sSQLITE_THREADSAFE\senabled.\s(CVS\s4269)
D 2007-08-22T11:22:04 D 2007-08-22T11:41:18
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 083c1205b45e3f52291ec539d396b4fc557856b3 F src/auth.c 083c1205b45e3f52291ec539d396b4fc557856b3
F src/btree.c 3e935a3074bfa498e74dc70f441cab64d364eab1 F src/btree.c 1e189c3a7ea8e34434b214a8d6b69727c3ed525c
F src/btree.h 76c89673981cb77575300c0b78a76eaa00a28743 F src/btree.h 76c89673981cb77575300c0b78a76eaa00a28743
F src/btreeInt.h 7fc6e51dc3d4bbed15639a8ea1aae737631d6670 F src/btreeInt.h 7fc6e51dc3d4bbed15639a8ea1aae737631d6670
F src/build.c 2159551184160e2cf17ff945e9a05fbe6f331c3d F src/build.c 2159551184160e2cf17ff945e9a05fbe6f331c3d
@ -127,17 +127,17 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c ac29402b538515fa4697282387be9c1205e6e9eb F src/shell.c ac29402b538515fa4697282387be9c1205e6e9eb
F src/sqlite.h.in 39f920631c49a8a79502d8b7908e608d7a0029bd F src/sqlite.h.in 39f920631c49a8a79502d8b7908e608d7a0029bd
F src/sqlite3ext.h 647a6b8a8f76ff6c9611e4a071531d8e63ff2d6b F src/sqlite3ext.h 647a6b8a8f76ff6c9611e4a071531d8e63ff2d6b
F src/sqliteInt.h 74eb61d596c0fb308a5ec07f060318f3a83474df F src/sqliteInt.h 67b6ed04a2b0c28957bc2cf064ce713d298022b3
F src/sqliteLimit.h f14609c27636ebc217c9603ade26dbdd7d0f6afa F src/sqliteLimit.h f14609c27636ebc217c9603ade26dbdd7d0f6afa
F src/table.c c725e47f6f3092b9a7b569fc58e408e2173ee008 F src/table.c c725e47f6f3092b9a7b569fc58e408e2173ee008
F src/tclsqlite.c 92e06e076d613484aa2afc5ad830d9080de92347 F src/tclsqlite.c 92e06e076d613484aa2afc5ad830d9080de92347
F src/test1.c d7b8d6d15d10cc2e21f7a20a09c914d5aa84f1e2 F src/test1.c d7b8d6d15d10cc2e21f7a20a09c914d5aa84f1e2
F src/test2.c 4f742e99ed1bea5c14692f627bdb59a146f30504 F src/test2.c 4f742e99ed1bea5c14692f627bdb59a146f30504
F src/test3.c a7d011c51d6b2e2a73c43983d5c2b731d69c74d7 F src/test3.c a7d011c51d6b2e2a73c43983d5c2b731d69c74d7
F src/test4.c d97b87919dc3db1cc5fccc04a33f030d5940e1a9 F src/test4.c c2c0f5dc907f1346f5d4b65eb5799f11eb9e4071
F src/test5.c 3a6a5717a149d7ca2e6d14f5be72cf7555d54dc4 F src/test5.c 3a6a5717a149d7ca2e6d14f5be72cf7555d54dc4
F src/test6.c da83a0e49c03e8a25f4ce6e25c537c6617c14fc0 F src/test6.c da83a0e49c03e8a25f4ce6e25c537c6617c14fc0
F src/test7.c 50f5aa04fd751528ad5ee50e9be9ecee6f0b574a F src/test7.c a9d509d0e9ad214b4772696f49f6e61be26213d1
F src/test8.c 4bf571b82e502094846ae06e30fe028f190aaaae F src/test8.c 4bf571b82e502094846ae06e30fe028f190aaaae
F src/test9.c b46c8fe02ac7cca1a7316436d8d38d50c66f4b2f F src/test9.c b46c8fe02ac7cca1a7316436d8d38d50c66f4b2f
F src/test_async.c 9f3ab66e848930d1c3a7bc2dde77b9b643f6e4ba F src/test_async.c 9f3ab66e848930d1c3a7bc2dde77b9b643f6e4ba
@ -559,7 +559,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 6cc8641ed2fbfc32d418ce153f2819052f230be2 P 581fadfe31757e3fb97b12f93c1e3c085e4b6009
R 60a77806fdc37cc90a1c02666401cadd R 04edf60a36c6b67ded0e1d8395cfcdd2
U danielk1977 U drh
Z ac8c850ecd87e6662e4865fbe6fa7e4b Z 751a55fa40ff7163f0ed16353fbe540e

View File

@ -1 +1 @@
581fadfe31757e3fb97b12f93c1e3c085e4b6009 1f28b7e47bba221c14a10a37e7425c9975bb2312

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.408 2007/08/22 02:56:43 drh Exp $ ** $Id: btree.c,v 1.409 2007/08/22 11:41:18 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.
@ -1372,13 +1372,10 @@ int sqlite3BtreeClose(Btree *p){
} }
#ifndef SQLITE_OMIT_SHARED_CACHE #ifndef SQLITE_OMIT_SHARED_CACHE
else{ assert( p->wantToLock==0 );
assert( p->wantToLock==0 ); assert( p->locked==0 );
assert( p->locked==0 ); if( p->pPrev ) p->pPrev->pNext = p->pNext;
assert( p->sharable ); if( p->pNext ) p->pNext->pPrev = p->pPrev;
if( p->pPrev ) p->pPrev->pNext = p->pNext;
if( p->pNext ) p->pNext->pPrev = p->pPrev;
}
#endif #endif
sqlite3_free(p); sqlite3_free(p);
@ -1482,10 +1479,10 @@ void sqlite3BtreeLeave(Btree *p){
** Short-cuts for entering and leaving mutexes on a cursor. ** Short-cuts for entering and leaving mutexes on a cursor.
*/ */
static void cursorLeave(BtCursor *p){ static void cursorLeave(BtCursor *p){
sqlite3BtreeLeave(p->pBt); sqlite3BtreeLeave(p->pBtree);
} }
static void cursorEnter(BtCursor *pCur){ static void cursorEnter(BtCursor *pCur){
sqlite3BtreeEnter(pCur->pBt); sqlite3BtreeEnter(pCur->pBtree);
} }
#else #else
# define cursorEnter(X) # define cursorEnter(X)
@ -3759,7 +3756,6 @@ static int btreeNext(BtCursor *pCur, int *pRes){
if( sqlite3BtreeIsRootPage(pPage) ){ if( sqlite3BtreeIsRootPage(pPage) ){
*pRes = 1; *pRes = 1;
pCur->eState = CURSOR_INVALID; pCur->eState = CURSOR_INVALID;
cursorLeave(pCur);
return SQLITE_OK; return SQLITE_OK;
} }
sqlite3BtreeMoveToParent(pCur); sqlite3BtreeMoveToParent(pCur);

View File

@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.596 2007/08/22 11:22:04 danielk1977 Exp $ ** @(#) $Id: sqliteInt.h,v 1.597 2007/08/22 11:41:18 drh Exp $
*/ */
#ifndef _SQLITEINT_H_ #ifndef _SQLITEINT_H_
#define _SQLITEINT_H_ #define _SQLITEINT_H_
@ -42,7 +42,7 @@
#if defined(THREADSAFE) #if defined(THREADSAFE)
# define SQLITE_THREADSAFE THREADSAFE # define SQLITE_THREADSAFE THREADSAFE
#else #else
# define SQLTIE_THREADSAFE 1 # define SQLITE_THREADSAFE 1
#endif #endif
#endif #endif

View File

@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Code for testing the the SQLite library in a multithreaded environment. ** Code for testing the the SQLite library in a multithreaded environment.
** **
** $Id: test4.c,v 1.20 2007/08/21 10:44:16 drh Exp $ ** $Id: test4.c,v 1.21 2007/08/22 11:41:18 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "tcl.h" #include "tcl.h"
@ -141,14 +141,14 @@ static int tcl_thread_create(
return TCL_ERROR; return TCL_ERROR;
} }
threadset[i].busy = 1; threadset[i].busy = 1;
sqliteFree(threadset[i].zFilename); sqlite3_free(threadset[i].zFilename);
threadset[i].zFilename = sqlite3StrDup(argv[2]); threadset[i].zFilename = sqlite3StrDup(argv[2]);
threadset[i].opnum = 1; threadset[i].opnum = 1;
threadset[i].completed = 0; threadset[i].completed = 0;
rc = pthread_create(&x, 0, thread_main, &threadset[i]); rc = pthread_create(&x, 0, thread_main, &threadset[i]);
if( rc ){ if( rc ){
Tcl_AppendResult(interp, "failed to create the thread", 0); Tcl_AppendResult(interp, "failed to create the thread", 0);
sqliteFree(threadset[i].zFilename); sqlite3_free(threadset[i].zFilename);
threadset[i].busy = 0; threadset[i].busy = 0;
return TCL_ERROR; return TCL_ERROR;
} }
@ -199,9 +199,9 @@ static void stop_thread(Thread *p){
p->xOp = 0; p->xOp = 0;
p->opnum++; p->opnum++;
thread_wait(p); thread_wait(p);
sqliteFree(p->zArg); sqlite3_free(p->zArg);
p->zArg = 0; p->zArg = 0;
sqliteFree(p->zFilename); sqlite3_free(p->zFilename);
p->zFilename = 0; p->zFilename = 0;
p->busy = 0; p->busy = 0;
} }
@ -475,7 +475,7 @@ static int tcl_thread_compile(
} }
thread_wait(&threadset[i]); thread_wait(&threadset[i]);
threadset[i].xOp = do_compile; threadset[i].xOp = do_compile;
sqliteFree(threadset[i].zArg); sqlite3_free(threadset[i].zArg);
threadset[i].zArg = sqlite3StrDup(argv[2]); threadset[i].zArg = sqlite3StrDup(argv[2]);
threadset[i].opnum++; threadset[i].opnum++;
return TCL_OK; return TCL_OK;
@ -570,7 +570,7 @@ static int tcl_thread_finalize(
} }
thread_wait(&threadset[i]); thread_wait(&threadset[i]);
threadset[i].xOp = do_finalize; threadset[i].xOp = do_finalize;
sqliteFree(threadset[i].zArg); sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0; threadset[i].zArg = 0;
threadset[i].opnum++; threadset[i].opnum++;
return TCL_OK; return TCL_OK;

View File

@ -12,7 +12,7 @@
** Code for testing the client/server version of the SQLite library. ** Code for testing the client/server version of the SQLite library.
** Derived from test4.c. ** Derived from test4.c.
** **
** $Id: test7.c,v 1.7 2007/08/21 10:44:16 drh Exp $ ** $Id: test7.c,v 1.8 2007/08/22 11:41:18 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "tcl.h" #include "tcl.h"
@ -163,14 +163,14 @@ static int tcl_client_create(
return TCL_ERROR; return TCL_ERROR;
} }
threadset[i].busy = 1; threadset[i].busy = 1;
sqliteFree(threadset[i].zFilename); sqlite3_free(threadset[i].zFilename);
threadset[i].zFilename = sqlite3StrDup(argv[2]); threadset[i].zFilename = sqlite3StrDup(argv[2]);
threadset[i].opnum = 1; threadset[i].opnum = 1;
threadset[i].completed = 0; threadset[i].completed = 0;
rc = pthread_create(&x, 0, client_main, &threadset[i]); rc = pthread_create(&x, 0, client_main, &threadset[i]);
if( rc ){ if( rc ){
Tcl_AppendResult(interp, "failed to create the thread", 0); Tcl_AppendResult(interp, "failed to create the thread", 0);
sqliteFree(threadset[i].zFilename); sqlite3_free(threadset[i].zFilename);
threadset[i].busy = 0; threadset[i].busy = 0;
return TCL_ERROR; return TCL_ERROR;
} }
@ -222,9 +222,9 @@ static void stop_thread(Thread *p){
p->xOp = 0; p->xOp = 0;
p->opnum++; p->opnum++;
client_wait(p); client_wait(p);
sqliteFree(p->zArg); sqlite3_free(p->zArg);
p->zArg = 0; p->zArg = 0;
sqliteFree(p->zFilename); sqlite3_free(p->zFilename);
p->zFilename = 0; p->zFilename = 0;
p->busy = 0; p->busy = 0;
} }
@ -506,7 +506,7 @@ static int tcl_client_compile(
} }
client_wait(&threadset[i]); client_wait(&threadset[i]);
threadset[i].xOp = do_compile; threadset[i].xOp = do_compile;
sqliteFree(threadset[i].zArg); sqlite3_free(threadset[i].zArg);
threadset[i].zArg = sqlite3StrDup(argv[2]); threadset[i].zArg = sqlite3StrDup(argv[2]);
threadset[i].opnum++; threadset[i].opnum++;
return TCL_OK; return TCL_OK;
@ -601,7 +601,7 @@ static int tcl_client_finalize(
} }
client_wait(&threadset[i]); client_wait(&threadset[i]);
threadset[i].xOp = do_finalize; threadset[i].xOp = do_finalize;
sqliteFree(threadset[i].zArg); sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0; threadset[i].zArg = 0;
threadset[i].opnum++; threadset[i].opnum++;
return TCL_OK; return TCL_OK;
@ -645,7 +645,7 @@ static int tcl_client_reset(
} }
client_wait(&threadset[i]); client_wait(&threadset[i]);
threadset[i].xOp = do_reset; threadset[i].xOp = do_reset;
sqliteFree(threadset[i].zArg); sqlite3_free(threadset[i].zArg);
threadset[i].zArg = 0; threadset[i].zArg = 0;
threadset[i].opnum++; threadset[i].opnum++;
return TCL_OK; return TCL_OK;