1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-24 14:17:58 +03:00

Fix errors in threadtest3 tests caused by earlier tests neglecting to close database handles.

FossilOrigin-Name: 1d44f1b1a9fefeb2449892775c59765c46784eb1
This commit is contained in:
dan
2014-12-15 08:46:17 +00:00
parent 053542d72a
commit d44b786ff6
3 changed files with 21 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
C Further\senhancements\sto\sthreadtest3\sstress\stests.
D 2014-12-13T17:41:48.275
C Fix\serrors\sin\sthreadtest3\stests\scaused\sby\searlier\stests\sneglecting\sto\sclose\sdatabase\shandles.
D 2014-12-15T08:46:17.172
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 6c4f961fa91d0b4fa121946a19f9e5eac2f2f809
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -912,7 +912,7 @@ F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
F test/threadtest2.c ace893054fa134af3fc8d6e7cfecddb8e3acefb9
F test/threadtest3.c 05d67ab8fd4ad82978a96200701a22af35faa097
F test/threadtest3.c c8629f836331dd4e5d6ef514b6696605cb593135
F test/threadtest4.c c1e67136ceb6c7ec8184e56ac61db28f96bd2925
F test/tkt-02a8e81d44.test 6c80d9c7514e2a42d4918bf87bf6bc54f379110c
F test/tkt-26ff0c2d1e.test 888324e751512972c6e0d1a09df740d8f5aaf660
@@ -1231,7 +1231,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P d7bb7ea4ab97ad26f4c84c9b8dc2827010093803
R 5d62798e848b5017221fa2f718c6fa3d
P ba772cff602ca7c3c0c91451e701f52a872e7a14
R ed0c57369d0ec456d80773711d0601f8
U dan
Z 748bf95122bf9ac21f60dff7348c8009
Z bfcc45ad20cf310717047c8b8c88d22b

View File

@@ -1 +1 @@
ba772cff602ca7c3c0c91451e701f52a872e7a14
1d44f1b1a9fefeb2449892775c59765c46784eb1

View File

@@ -1343,6 +1343,7 @@ static char *dynamic_triggers_1(int iTid, void *pArg){
nDrop++;
}
}
closedb(&err, &db);
print_and_free_err(&err);
return sqlite3_mprintf("%d created, %d dropped", nCreate, nDrop);
@@ -1369,6 +1370,7 @@ static char *dynamic_triggers_2(int iTid, void *pArg){
nDelete++;
} while( iVal );
}
closedb(&err, &db);
print_and_free_err(&err);
return sqlite3_mprintf("%d inserts, %d deletes", nInsert, nDelete);
@@ -1393,6 +1395,7 @@ static void dynamic_triggers(int nMs){
"CREATE TABLE t8(x, y);"
"CREATE TABLE t9(x, y);"
);
closedb(&err, &db);
setstoptime(&err, nMs);
@@ -1446,32 +1449,24 @@ int main(int argc, char **argv){
};
int i;
char *zTest = 0;
int nTest = 0;
int bTestfound = 0;
int bPrefix = 0;
if( argc>2 ) goto usage;
if( argc==2 ){
zTest = argv[1];
nTest = strlen(zTest);
if( zTest[nTest-1]=='*' ){
nTest--;
bPrefix = 1;
}
}
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
char const *z = aTest[i].zTest;
int n = strlen(z);
if( !zTest || ((bPrefix || n==nTest) && 0==strncmp(zTest, z, nTest)) ){
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
aTest[i].xTest(aTest[i].nMs);
bTestfound++;
if( argc>1 ){
int iArg;
for(iArg=1; iArg<argc; iArg++){
if( 0==sqlite3_strglob(argv[iArg], z) ) break;
}
if( iArg==argc ) continue;
}
printf("Running %s for %d seconds...\n", z, aTest[i].nMs/1000);
aTest[i].xTest(aTest[i].nMs);
bTestfound++;
}
if( bTestfound==0 ) goto usage;
@@ -1479,7 +1474,7 @@ int main(int argc, char **argv){
return (nGlobalErr>0 ? 255 : 0);
usage:
printf("Usage: %s [testname|testprefix*]\n", argv[0]);
printf("Usage: %s [testname|testprefix*]...\n", argv[0]);
printf("Available tests are:\n");
for(i=0; i<sizeof(aTest)/sizeof(aTest[0]); i++){
printf(" %s\n", aTest[i].zTest);