1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Merge in the latest changes from the trunk.

FossilOrigin-Name: 435b57dc2be7b071270a6cddece297758b8153aa
This commit is contained in:
drh
2011-04-06 22:33:50 +00:00
18 changed files with 270 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
C Merge\sthe\slatest\strunk\schanges\sinto\sthe\ssessions\sbranch.
D 2011-04-05T22:13:49.215
C Merge\sin\sthe\slatest\schanges\sfrom\sthe\strunk.
D 2011-04-06T22:33:50.737
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 7a4d9524721d40ef9ee26f93f9bd6a51dba106f2
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -129,9 +129,9 @@ F src/attach.c 7cae2cf0c14762ce14c074a860ec52890a973a56
F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
F src/backup.c b7529a6691f0fd534ae8ff622203c46a7f1b626b
F src/bitvec.c af50f1c8c0ff54d6bdb7a80e2fceca5a93670bef
F src/btmutex.c 7907af20b954a8605766fbd2d87b47647422960e
F src/btree.c 6002f05e15aca2f22ab072a0be13b7394a8c0858
F src/btree.h 221e186cd64127088890a878aaab154344380fe8
F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
F src/btree.c 4fcad108b612a4d33dac568b11d26e4d38ccbe35
F src/btree.h 11753dd46597a20702bca8746cb4caa4486a82b5
F src/btreeInt.h 67978c014fa4f7cc874032dd3aacadd8db656bc3
F src/build.c b7c993274ee2a029937b0bc4815bdef80b330017
F src/callback.c 0425c6320730e6d3981acfb9202c1bed9016ad1a
@@ -151,7 +151,7 @@ F src/insert.c ef33ce1522a77f6d8077f0bdb6ab22d306900950
F src/journal.c 552839e54d1bf76fb8f7abe51868b66acacf6a0e
F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
F src/loadext.c 8af9fcc75708d60b88636ccba38b4a7b3c155c3e
F src/loadext.c 3ae0d52da013a6326310655be6473fd472347b85
F src/main.c 37608a8346394e52690368742d734f7b01330aaa
F src/malloc.c 788f2ed928786dfe305b6783d551d6b1a9080976
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
@@ -171,7 +171,7 @@ F src/os.c 22ac61d06e72a0dac900400147333b07b13d8e1d
F src/os.h 9dbed8c2b9c1f2f2ebabc09e49829d4777c26bf9
F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
F src/os_os2.c 2596fd2d5d0976c6c0c628d0c3c7c4e7a724f4cf
F src/os_unix.c 32414676594a0a26cfccd7e02656230a3406eee7
F src/os_unix.c a8fe62148d41e54e383d3360a711a01595feef58
F src/os_win.c 24d72407a90551969744cf9bcbb1b4c72c5fa845
F src/pager.c 055239dcdfe12b3f5d97f6f01f85da01e2d6d912
F src/pager.h 3f8c783de1d4706b40b1ac15b64f5f896bcc78d1
@@ -185,12 +185,12 @@ F src/printf.c 585a36b6a963df832cfb69505afa3a34ed5ef8a1
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
F src/resolve.c 1c0f32b64f8e3f555fe1f732f9d6f501a7f05706
F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
F src/select.c d24406c45dd2442eb2eeaac413439066b149c944
F src/select.c 649a6f10f7eb7b52a5a28847773cb9968a828ae8
F src/shell.c a73b30067ec15f116d5d0c28880179898fbe3d0b
F src/sqlite.h.in 235300cdca517ce148385d3ab816e7e8cf9e1ff3
F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754
F src/sqliteInt.h 0873a71099f763cdf24cfabf04a237ad100e20d0
F src/sqliteLimit.h a17dcd3fb775d63b64a43a55c54cb282f9726f44
F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c fe0da0eb0ebd8d21eec90683b779456e64351de6
@@ -228,7 +228,7 @@ F src/test_pcache.c 7bf828972ac0d2403f5cfa4cd14da41f8ebe73d8
F src/test_quota.c b5576f17d701af461effd7ca1e71f0d100071192
F src/test_rtree.c 30c981837445a4e187ee850a49c4760d9642f7c3
F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0
F src/test_server.c 88caa13d33cb85a4f924229bd9693acd8e1429ba
F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f
F src/test_stat.c f682704b5d1ba8e1d4e7e882a6d7922e2dcf066c
F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd
F src/test_syscall.c 162c4ec0137a549c009bb9ecab550527743cfc5d
@@ -244,11 +244,11 @@ F src/update.c 3f3f3bb734a0da1dffd0ed33e504642b35ed3605
F src/utf.c d83650c3ea08f7407bd9d0839d9885241c209c60
F src/util.c cd997077bad039efc0597eb027c929658f93c018
F src/vacuum.c 05513dca036a1e7848fe18d5ed1265ac0b32365e
F src/vdbe.c b6bcbe5663d942d49d7a2e25d437fed82da5b709
F src/vdbe.c dd53dda1cf786397e72643a497b5c2f368ff11ba
F src/vdbe.h 44fd57aeed86da0cd31206626c13cdde0e72cc0e
F src/vdbeInt.h 3dec3d5b88173c6aad0a6bc23d58142636c6cb82
F src/vdbeInt.h b95de01246c15499c700ae00cfda0de25c01358a
F src/vdbeapi.c 8051038f7674c708f4515ab189fc3ea929e09a4c
F src/vdbeaux.c 88671caaee3ef9c5e600486b3961c395bc4ac493
F src/vdbeaux.c b0a2a184a25380f7eb9d07e9336034ec38d1b213
F src/vdbeblob.c c3ccb7c8732858c680f442932e66ad06bb036562
F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
F src/vdbetrace.c 3ba13bc32bdf16d2bdea523245fd16736bed67b5
@@ -280,6 +280,7 @@ F test/async5.test f3592d79c84d6e83a5f50d3fd500445f7d97dfdf
F test/attach.test 2bb09073d7d5499127db00f50780766dcea913e1
F test/attach2.test a295d2d7061adcee5884ef4a93c7c96a82765437
F test/attach3.test bd9830bc3a0d22ed1310c9bff6896927937017dc
F test/attach4.test d58859e62e0a70f17481eed01bf94995f72fea7f
F test/attachmalloc.test 1d5b821a676f7bf0b00d87cc106b78966789ba57
F test/auth.test b047105c32da7db70b842fd24056723125ecc2ff
F test/auth2.test 270baddc8b9c273682760cffba6739d907bd2882
@@ -628,7 +629,7 @@ F test/randexpr1.test 1084050991e9ba22c1c10edd8d84673b501cc25a
F test/rdonly.test c267d050a1d9a6a321de502b737daf28821a518d
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a
F test/releasetest.tcl 02497b7fb9c53fa65fc8757de7675987cd571068
F test/releasetest.tcl c0c0865f1dff08dde08a964ef49e83217ebedbf8
F test/rollback.test 1a83118ea6db4e7d8c10eaa63871b5e90502ffdc
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
F test/rowid.test e58e0acef38b527ed1b0b70d3ada588f804af287
@@ -687,7 +688,7 @@ F test/subselect.test d24fd8757daf97dafd2e889c73ea4c4272dcf4e4
F test/substr.test 18f57c4ca8a598805c4d64e304c418734d843c1a
F test/superlock.test 5d7a4954b0059c903f82c7b67867bc5451a7c082
F test/sync.test ded6b39d8d8ca3c0c5518516c6371b3316d3e3a3
F test/syscall.test 02e5359bf4f5e6f716696318fde4e0b5c2c70d21
F test/syscall.test 707c95e4ab7863e13f1293c6b0c76bead30249b3
F test/sysfault.test c79441d88d23696fbec7b147dba98d42a04f523f
F test/table.test 04ba066432430657712d167ebf28080fe878d305
F test/tableapi.test 2674633fa95d80da917571ebdd759a14d9819126
@@ -870,7 +871,7 @@ F test/vtabE.test 7c4693638d7797ce2eda17af74292b97e705cc61
F test/vtab_alter.test 9e374885248f69e251bdaacf480b04a197f125e5
F test/vtab_err.test 0d4d8eb4def1d053ac7c5050df3024fd47a3fbd8
F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d
F test/wal.test 084b086913a205eab4dde4b9a9cf8c781a576bb8
F test/wal.test bac92a13276ce9b65d3d5c9ff3411d24c795826c
F test/wal2.test e561a8c6fdd1c2cd1876f3e39757934e7b7361f8
F test/wal3.test 5c396cc22497244d627306f4c1d360167353f8dd
F test/wal4.test 3404b048fa5e10605facaf70384e6d2943412e30
@@ -915,7 +916,7 @@ F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c.tcl 623e26cc8c83322e4151d3ad85ac69d41221bae8
F tool/mksqlite3h.tcl d76c226a5e8e1f3b5f6593bcabe5e98b3b1ec9ff
F tool/mksqlite3internalh.tcl 7b43894e21bcb1bb39e11547ce7e38a063357e87
F tool/omittest.tcl 4f4cc66bb7ca6a5b8f61ee37b6333f60fb8a746a
F tool/omittest.tcl b1dd290c1596e0f31fd335160a74ec5dfea3df4a
F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c
F tool/restore_jrnl.tcl 6957a34f8f1f0f8285e07536225ec3b292a9024a
F tool/shell1.test f608a009b04c490fd360c5ded458a6f98b4e7ec4
@@ -936,7 +937,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 03ca83422f0259ae5525aeecc14171811252a67d 3eeb0ff78d04891b5fd1a3d99a9fb8cfbed77a81
R f0650bbd397ea127a3fadf071b0b957e
P 45f20261720dcd73eb887f7e3df100723000418b 614de91a504d2231009a9de1305e31fce1b1c5a6
R 502dde3bb5feee985b14f915e41e9858
U drh
Z 199b5e50f9e261886cd6678fe8286ef5
Z 9b010756d90228476ef26682d9d1164b

View File

@@ -1 +1 @@
45f20261720dcd73eb887f7e3df100723000418b
435b57dc2be7b071270a6cddece297758b8153aa

View File

@@ -203,6 +203,14 @@ void sqlite3BtreeLeaveAll(sqlite3 *db){
}
}
/*
** Return true if a particular Btree requires a lock. Return FALSE if
** no lock is ever required since it is not sharable.
*/
int sqlite3BtreeSharable(Btree *p){
return p->sharable;
}
#ifndef NDEBUG
/*
** Return true if the current thread holds the database connection

View File

@@ -2127,7 +2127,6 @@ int sqlite3BtreeSyncDisabled(Btree *p){
return rc;
}
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM)
/*
** Change the default pages size and the number of reserved bytes per page.
** Or, if the page size has already been fixed, return SQLITE_READONLY
@@ -2182,6 +2181,7 @@ int sqlite3BtreeGetPageSize(Btree *p){
return p->pBt->pageSize;
}
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM)
/*
** Return the number of bytes of space at the end of every page that
** are intentually left unused. This is the "reserved" space that is

View File

@@ -212,6 +212,7 @@ void sqlite3BtreeCursorList(Btree*);
#endif
#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE
int sqlite3BtreeSharable(Btree*);
void sqlite3BtreeLeave(Btree*);
void sqlite3BtreeEnterCursor(BtCursor*);
void sqlite3BtreeLeaveCursor(BtCursor*);
@@ -224,6 +225,7 @@ void sqlite3BtreeCursorList(Btree*);
#endif
#else
# define sqlite3BtreeSharable(X) 0
# define sqlite3BtreeLeave(X)
# define sqlite3BtreeEnterCursor(X)
# define sqlite3BtreeLeaveCursor(X)

View File

@@ -71,6 +71,11 @@
# define sqlite3_complete16 0
#endif
#ifdef SQLITE_OMIT_DECLTYPE
# define sqlite3_column_decltype16 0
# define sqlite3_column_decltype 0
#endif
#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
# define sqlite3_progress_handler 0
#endif

View File

@@ -3398,18 +3398,17 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){
*/
int nBlk = buf.st_blksize; /* File-system block size */
i64 iWrite; /* Next offset to write to */
int nWrite; /* Return value from seekAndWrite() */
if( robust_ftruncate(pFile->h, nSize) ){
pFile->lastErrno = errno;
return unixLogError(SQLITE_IOERR_TRUNCATE, "ftruncate", pFile->zPath);
}
iWrite = ((buf.st_size + 2*nBlk - 1)/nBlk)*nBlk-1;
do {
nWrite = seekAndWrite(pFile, iWrite, "", 1);
while( iWrite<nSize ){
int nWrite = seekAndWrite(pFile, iWrite, "", 1);
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
iWrite += nBlk;
} while( nWrite==1 && iWrite<nSize );
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
}
#endif
}
}

View File

@@ -806,6 +806,22 @@ static void explainTempTable(Parse *pParse, const char *zUsage){
}
}
/*
** Assign expression b to lvalue a. A second, no-op, version of this macro
** is provided when SQLITE_OMIT_EXPLAIN is defined. This allows the code
** in sqlite3Select() to assign values to structure member variables that
** only exist if SQLITE_OMIT_EXPLAIN is not defined without polluting the
** code with #ifndef directives.
*/
# define explainSetInteger(a, b) a = b
#else
/* No-op versions of the explainXXX() functions and macros. */
# define explainTempTable(y,z)
# define explainSetInteger(y,z)
#endif
#if !defined(SQLITE_OMIT_EXPLAIN) && !defined(SQLITE_OMIT_COMPOUND_SELECT)
/*
** Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
** is a no-op. Otherwise, it adds a single row of output to the EQP result,
@@ -837,21 +853,9 @@ static void explainComposite(
sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
}
}
/*
** Assign expression b to lvalue a. A second, no-op, version of this macro
** is provided when SQLITE_OMIT_EXPLAIN is defined. This allows the code
** in sqlite3Select() to assign values to structure member variables that
** only exist if SQLITE_OMIT_EXPLAIN is not defined without polluting the
** code with #ifndef directives.
*/
# define explainSetInteger(a, b) a = b
#else
/* No-op versions of the explainXXX() functions and macros. */
# define explainTempTable(y,z)
# define explainComposite(v,w,x,y,z)
# define explainSetInteger(y,z)
#endif
/*

View File

@@ -118,7 +118,7 @@
/*
** The maximum number of attached databases. This must be between 0
** and 30. The upper bound on 30 is because a 32-bit integer bitmap
** and 62. The upper bound on 62 is because a 64-bit integer bitmap
** is used internally to track attached databases.
*/
#ifndef SQLITE_MAX_ATTACHED

View File

@@ -453,7 +453,6 @@ void *sqlite3_server(void *NotUsed){
pthread_mutex_unlock(&pMsg->clientMutex);
pthread_cond_signal(&pMsg->clientWakeup);
}
sqlite3_thread_cleanup();
pthread_mutex_unlock(&g.serverMutex);
return 0;
}

View File

@@ -4697,8 +4697,6 @@ case OP_ParseSchema: {
assert( iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[iDb].pBt) );
}
#endif
assert( p->btreeMask == ~(yDbMask)0 );
iDb = pOp->p1;
assert( iDb>=0 && iDb<db->nDb );

View File

@@ -303,6 +303,7 @@ struct Vdbe {
u8 isPrepareV2; /* True if prepared with prepare_v2() */
int nChange; /* Number of db changes made since last reset */
yDbMask btreeMask; /* Bitmask of db->aDb[] entries referenced */
yDbMask lockMask; /* Subset of btreeMask that requires a lock */
int iStatement; /* Statement number (or 0 if has not opened stmt) */
int aCounter[3]; /* Counters used by sqlite3_stmt_status() */
#ifndef SQLITE_OMIT_TRACE

View File

@@ -161,7 +161,8 @@ int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, int p3){
if( op==OP_ParseSchema ){
/* Any program that uses the OP_ParseSchema opcode needs to lock
** all btrees. */
p->btreeMask = ~(yDbMask)0;
int j;
for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j);
}
#ifdef SQLITE_DEBUG
pOp->zComment = 0;
@@ -959,6 +960,9 @@ void sqlite3VdbeUsesBtree(Vdbe *p, int i){
assert( i>=0 && i<p->db->nDb && i<(int)sizeof(yDbMask)*8 );
assert( i<(int)sizeof(p->btreeMask)*8 );
p->btreeMask |= ((yDbMask)1)<<i;
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){
p->lockMask |= ((yDbMask)1)<<i;
}
}
#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE>0
@@ -986,11 +990,15 @@ void sqlite3VdbeUsesBtree(Vdbe *p, int i){
void sqlite3VdbeEnter(Vdbe *p){
int i;
yDbMask mask;
sqlite3 *db = p->db;
Db *aDb = db->aDb;
int nDb = db->nDb;
sqlite3 *db;
Db *aDb;
int nDb;
if( p->lockMask==0 ) return; /* The common case */
db = p->db;
aDb = db->aDb;
nDb = db->nDb;
for(i=0, mask=1; i<nDb; i++, mask += mask){
if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
sqlite3BtreeEnter(aDb[i].pBt);
}
}
@@ -1004,12 +1012,15 @@ void sqlite3VdbeEnter(Vdbe *p){
void sqlite3VdbeLeave(Vdbe *p){
int i;
yDbMask mask;
sqlite3 *db = p->db;
Db *aDb = db->aDb;
int nDb = db->nDb;
sqlite3 *db;
Db *aDb;
int nDb;
if( p->lockMask==0 ) return; /* The common case */
db = p->db;
aDb = db->aDb;
nDb = db->nDb;
for(i=0, mask=1; i<nDb; i++, mask += mask){
if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
sqlite3BtreeLeave(aDb[i].pBt);
}
}

112
test/attach4.test Normal file
View File

@@ -0,0 +1,112 @@
# 200 July 1
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. The
# focus of this script is attaching many database files to a single
# connection.
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix attach4
ifcapable !attach {
finish_test
return
}
puts "Testing with SQLITE_MAX_ATTACHED=$SQLITE_MAX_ATTACHED"
set files {main test.db}
for {set ii 0} {$ii < $SQLITE_MAX_ATTACHED} {incr ii} {
lappend files aux$ii "test.db$ii"
}
do_test 1.1 {
sqlite3_limit db SQLITE_LIMIT_ATTACHED -1
} $SQLITE_MAX_ATTACHED
do_test 1.2.1 {
db close
foreach {name f} $files { forcedelete $f }
sqlite3 db test.db
foreach {name f} $files {
if {$name == "main"} continue
execsql "ATTACH '$f' AS $name"
}
db eval {PRAGMA database_list} {
lappend L $name [file tail $file]
}
set L
} $files
do_catchsql_test 1.2.2 {
ATTACH 'x.db' AS next;
} [list 1 "too many attached databases - max $SQLITE_MAX_ATTACHED"]
do_test 1.3 {
execsql BEGIN;
foreach {name f} $files {
execsql "CREATE TABLE $name.tbl(x)"
execsql "INSERT INTO $name.tbl VALUES('$f')"
}
execsql COMMIT;
} {}
do_test 1.4 {
set L [list]
foreach {name f} $files {
lappend L $name [execsql "SELECT x FROM $name.tbl"]
}
set L
} $files
set L [list]
set S ""
foreach {name f} $files {
lappend L wal
append S "
PRAGMA $name.journal_mode = WAL;
UPDATE $name.tbl SET x = '$name';
"
}
do_execsql_test 1.5 $S $L
do_test 1.6 {
set L [list]
foreach {name f} $files {
lappend L [execsql "SELECT x FROM $name.tbl"] $f
}
set L
} $files
do_test 1.7 {
execsql BEGIN;
foreach {name f} $files {
execsql "UPDATE $name.tbl SET x = '$f'"
}
execsql COMMIT;
} {}
do_test 1.8 {
set L [list]
foreach {name f} $files {
lappend L $name [execsql "SELECT x FROM $name.tbl"]
}
set L
} $files
db close
foreach {name f} $files { forcedelete $f }
finish_test

View File

@@ -60,6 +60,11 @@ array set ::Configs {
"Default" {
-O2
}
"Ftrapv" {
-O2 -ftrapv
-DSQLITE_MAX_ATTACHED=55
-DSQLITE_TCL_DEFAULT_FULLMUTEX=1
}
"Unlock-Notify" {
-O2
-DSQLITE_ENABLE_UNLOCK_NOTIFY
@@ -144,6 +149,7 @@ array set ::Configs {
}
"Extra-Robustness" {
-DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
-DSQLITE_MAX_ATTACHED=62
}
}
@@ -155,6 +161,7 @@ array set ::Platforms {
"Debug-One" test
"Extra-Robustness" test
"Device-Two" test
"Ftrapv" test
"Default" "threadtest test"
"Device-One" fulltest
}

View File

@@ -239,7 +239,6 @@ do_test 8.1 {
file_control_chunksize_test db main 4096
file size test.db
} {0}
foreach {tn hint size} {
1 1000 4096
2 1000 4096
@@ -253,5 +252,25 @@ foreach {tn hint size} {
} $size
}
do_test 8.3 {
db close
forcedelete test.db test.db2
sqlite3 db test.db
file_control_chunksize_test db main 16
file size test.db
} {0}
foreach {tn hint size} {
1 5 16
2 13 16
3 45 48
4 48 48
5 49 64
} {
do_test 8.4.$tn {
file_control_sizehint_test db main $hint
file size test.db
} $size
}
test_syscall reset
finish_test

View File

@@ -1530,26 +1530,26 @@ ifcapable autovacuum {
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
} {wal}
do_execsql_test 24.2 {
DELETE FROM t1;
PRAGMA wal_checkpoint;
} {0 109 109}
do_test 24.3 {
do_test 24.2 {
execsql {
DELETE FROM t1;
PRAGMA wal_checkpoint;
}
db close
sqlite3 db test.db
file exists test.db-wal
} 0
do_test 24.4 {
do_test 24.3 {
file size test.db
} [expr 84 * 1024]
do_test 24.5 {
do_test 24.4 {
execsql {
PRAGMA incremental_vacuum;
PRAGMA wal_checkpoint;
}
file size test.db
} [expr 3 * 1024]
do_test 24.6 {
do_test 24.5 {
file size test.db-wal
} 2128
}

View File

@@ -8,7 +8,7 @@ This Tcl script is used to test the various compile time options
available for omitting code (the SQLITE_OMIT_xxx options). It
should be invoked as follows:
<script> ?-makefile PATH-TO-MAKEFILE? ?-skip_run?
<script> ?test-symbol? ?-makefile PATH-TO-MAKEFILE? ?-skip_run?
The default value for ::MAKEFILE is "../Makefile.linux.gcc".
@@ -120,11 +120,11 @@ catch {
#
proc process_options {argv} {
if {$::tcl_platform(platform)=="windows" || $::tcl_platform(platform)=="os2"} {
set ::MAKEFILE ./Makefile ;# Default value
set ::MAKEFILE ./Makefile ;# Default value
} else {
set ::MAKEFILE ./Makefile.linux-gcc ;# Default value
set ::MAKEFILE ./Makefile.linux-gcc ;# Default value
}
set ::SKIP_RUN 0 ;# Default to attempt test
set ::SKIP_RUN 0 ;# Default to attempt test
for {set i 0} {$i < [llength $argv]} {incr i} {
switch -- [lindex $argv $i] {
@@ -134,13 +134,15 @@ proc process_options {argv} {
}
-skip_run {
incr i
set ::SKIP_RUN 1
}
default {
puts stderr [string trim $::USAGE_MESSAGE]
exit -1
if {[info exists ::SYMBOL]} {
puts stderr [string trim $::USAGE_MESSAGE]
exit -1
}
set ::SYMBOL [lindex $argv $i]
}
}
set ::MAKEFILE [file normalize $::MAKEFILE]
@@ -241,31 +243,43 @@ proc main {argv} {
# Process any command line options.
process_options $argv
# First try a test with all OMIT symbols except SQLITE_OMIT_FLOATING_POINT
# and SQLITE_OMIT_PRAGMA defined. The former doesn't work (causes segfaults)
# and the latter is currently incompatible with the test suite (this should
# be fixed, but it will be a lot of work).
set allsyms [list]
foreach s $::OMIT_SYMBOLS {
if {$s!="SQLITE_OMIT_FLOATING_POINT" && $s!="SQLITE_OMIT_PRAGMA"} {
lappend allsyms $s
if {[info exists ::SYMBOL] } {
set sym $::SYMBOL
if {[lsearch $::OMIT_SYMBOLS $sym]<0 && [lsearch $::ENABLE_SYMBOLS $sym]<0} {
puts stderr "No such symbol: $sym"
exit -1
}
}
run_quick_test test_OMIT_EVERYTHING $allsyms
# Now try one quick.test with each of the OMIT symbols defined. Included
# are the OMIT_FLOATING_POINT and OMIT_PRAGMA symbols, even though we
# know they will fail. It's good to be reminded of this from time to time.
foreach sym $::OMIT_SYMBOLS {
set dirname "test_[string range $sym 7 end]"
run_quick_test $dirname $sym
}
} else {
# First try a test with all OMIT symbols except SQLITE_OMIT_FLOATING_POINT
# and SQLITE_OMIT_PRAGMA defined. The former doesn't work (causes segfaults)
# and the latter is currently incompatible with the test suite (this should
# be fixed, but it will be a lot of work).
set allsyms [list]
foreach s $::OMIT_SYMBOLS {
if {$s!="SQLITE_OMIT_FLOATING_POINT" && $s!="SQLITE_OMIT_PRAGMA"} {
lappend allsyms $s
}
}
run_quick_test test_OMIT_EVERYTHING $allsyms
# Try the ENABLE/DISABLE symbols one at a time.
# We don't do them all at once since some are conflicting.
foreach sym $::ENABLE_SYMBOLS {
set dirname "test_[string range $sym 7 end]"
run_quick_test $dirname $sym
# Now try one quick.test with each of the OMIT symbols defined. Included
# are the OMIT_FLOATING_POINT and OMIT_PRAGMA symbols, even though we
# know they will fail. It's good to be reminded of this from time to time.
foreach sym $::OMIT_SYMBOLS {
set dirname "test_[string range $sym 7 end]"
run_quick_test $dirname $sym
}
# Try the ENABLE/DISABLE symbols one at a time.
# We don't do them all at once since some are conflicting.
foreach sym $::ENABLE_SYMBOLS {
set dirname "test_[string range $sym 7 end]"
run_quick_test $dirname $sym
}
}
}