diff options
author | danielk1977 <danielk1977@noemail.net> | 2005-01-16 09:06:33 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2005-01-16 09:06:33 +0000 |
commit | 4e17d14c637f951d3ee52854961b2684caa2287d (patch) | |
tree | cd8676da0c27d067eac2b076ef206ea58c5aba0b | |
parent | 79a40da6d7664baef7bbec29904ff78f7a825281 (diff) | |
download | sqlite-4e17d14c637f951d3ee52854961b2684caa2287d.tar.gz sqlite-4e17d14c637f951d3ee52854961b2684caa2287d.zip |
Fixes so that compiling and testing works when SQLITE_OMIT_AUTOVACUUM is defined. (CVS 2218)
FossilOrigin-Name: fe548561a0e7a696fd453372f4427cf3e3f19d20
-rw-r--r-- | manifest | 24 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/btree.c | 7 | ||||
-rw-r--r-- | test/autovacuum_crash.test | 10 | ||||
-rw-r--r-- | test/autovacuum_ioerr.test | 10 | ||||
-rw-r--r-- | test/autovacuum_ioerr2.test | 9 | ||||
-rw-r--r-- | test/crash.test | 14 | ||||
-rw-r--r-- | test/ioerr.test | 10 | ||||
-rw-r--r-- | test/misuse.test | 3 |
9 files changed, 50 insertions, 39 deletions
@@ -1,5 +1,5 @@ -C Move\sduplicate\scode\sto\supdate\spointer-map\swrt\soverflow\spages\sinto\sa\sfunction.\s(CVS\s2217) -D 2005-01-16T08:00:01 +C Fixes\sso\sthat\scompiling\sand\stesting\sworks\swhen\sSQLITE_OMIT_AUTOVACUUM\sis\sdefined.\s(CVS\s2218) +D 2005-01-16T09:06:34 F Makefile.in 6ce51dde6a8fe82fc12f20dec750572f6a19f56a F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1 @@ -29,7 +29,7 @@ F sqlite3.def dbaeb20c153e1d366e8f421b55a573f5dfc00863 F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a F src/attach.c e49d09dad9f5f9fb10b4b0c1be5a70ae4c45e689 F src/auth.c 3b81f2a42f48a62c2c9c9b0eda31a157c681edea -F src/btree.c a007420eaced555faf95bba82260a6581a53ce24 +F src/btree.c 77e7ab4f356418bfc1e0992919c1d5c554ebe3da F src/btree.h 74d19cf40ab49fd69abe9e4e12a6c321ad86c497 F src/build.c af1296e8a21a406b4f4c4f1e1365e075071219f3 F src/cursor.c f883813759742068890b1f699335872bfa8fdf41 @@ -92,9 +92,9 @@ F test/attach3.test c05c70b933afbde0901dab9da3e66ee842c09f38 F test/auth.test 559e0816b8100740624ebb0ab7aab05f5c92831c F test/autoinc.test c071e51ff167b8e889212273588d9cca71845b70 F test/autovacuum.test a15021f685f2b3be5ad120f35b5a9f413a950702 -F test/autovacuum_crash.test 2dca85cbcc497098e45e8847c86407eb3554f3d4 -F test/autovacuum_ioerr.test 55ea907df34edb9be78a910a1636c2eb3c17ecc4 -F test/autovacuum_ioerr2.test ce5d4ff67a022f02dd594c15bf246e50680d8a65 +F test/autovacuum_crash.test 05a63b8805b20cfba7ace82856ce4ccdda075a31 +F test/autovacuum_ioerr.test 9cf27275ca47b72e188a47c53b61b6d583a01d24 +F test/autovacuum_ioerr2.test c4c8943eebf5051f773ec9739461318f057e5c15 F test/bigfile.test d3744a8821ce9abb8697f2826a3e3d22b719e89f F test/bigrow.test f0aeb7573dcb8caaafea76454be3ade29b7fc747 F test/bind.test 578c6526f9e7298a8993815336d676a12684b0cd @@ -117,7 +117,7 @@ F test/collate6.test 6c9470d1606ee3e564675b229653e320c49ec638 F test/conflict.test c5b849b01cfbe0a4f63a90cba6f68e2fe3a75f87 F test/corrupt.test 0080ddcece23e8ba47c44608c4fb73fd4d1d8ce2 F test/corrupt2.test cb1f813df7559de3021e01170af0bba31507a9a5 -F test/crash.test 03aa56f873bdf9ca1beda5c5a76a6500106f2844 +F test/crash.test fa5d79ece85e8f6677bd81703db5f869a15963aa F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/cursor.test d7c65ea0fc4e321e12fbcf5c7f3e2211ef45379b F test/date.test ef6c679d0b59502457dbd78ee1c3c085c949c4c4 @@ -139,7 +139,7 @@ F test/insert2.test 0bb50ff999e35a21549d8ee5dc44db8ac24d31a7 F test/insert3.test fa7cb5b01709a1bca3e28c82c80c1d44386b3676 F test/interrupt.test 5b4d8389e6cf2d01b94f87cfd02d9df1073bfb2d F test/intpkey.test b57cf5236fde1bd8cbc1388fa0c91908f6fd9194 -F test/ioerr.test fe51bacd7ffb83b9a0b70eceee3608dfd36371f6 +F test/ioerr.test f2072906ed3a8d136c8ed0dcee70a07e5cd2f061 F test/join.test ea8c77b9fbc377fe553cdb5ce5f1bd72021dca5d F test/join2.test c97e4c5aa65dea462145529e58212a709b4722b8 F test/join3.test 67dc0d7c8dab3fff25796d0f3c3fd9c999aeded3 @@ -159,7 +159,7 @@ F test/misc1.test 744f60d1025fa978708b96cb222a07a1feb1524a F test/misc2.test bc852f1622d98b610d1f3e2ceb36ed7271256050 F test/misc3.test 928a2f1e1189924ed14e1ae074e34f40688bdf94 F test/misc4.test 7edc2542eadd98555c2d25c222b88a93124975ae -F test/misuse.test 2d7c46160f7c214f761fc5d030684a37ae8832a6 +F test/misuse.test 600738a8e611989bc5f544303f5e311c5f228084 F test/notnull.test 7a08117a71e74b0321aaa937dbeb41a09d6eb1d0 F test/null.test 5a945790ef21b24fd602fe2c7a23847b903f8687 F test/pager.test 5ac7ce028a697283846d7e0c01622d253c8df1ef @@ -269,7 +269,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0 F www/whentouse.tcl c3b50d3ac31c54be2a1af9b488a89d22f1e6e746 -P 0ae29538ccccfc237904cbcfb4507074db0f5905 -R 983f36f11ba46bcdb0dbd6d8fd3e81a2 +P a5c2121410476ee1bf81881fdf5917e3e16f0399 +R bd23b0a3dffc23b81bb6c41f440ce89a U danielk1977 -Z ca69fe793079786f4174a1ca82437b0c +Z 357ec6a25a79ec0e067fcb4be6fdfd6c diff --git a/manifest.uuid b/manifest.uuid index 143816025..44581a8e9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a5c2121410476ee1bf81881fdf5917e3e16f0399
\ No newline at end of file +fe548561a0e7a696fd453372f4427cf3e3f19d20
\ No newline at end of file diff --git a/src/btree.c b/src/btree.c index d3869de66..a969dd195 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.235 2005/01/16 08:00:01 danielk1977 Exp $ +** $Id: btree.c,v 1.236 2005/01/16 09:06:34 danielk1977 Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to @@ -3726,7 +3726,7 @@ static int balance_nonroot(MemPage *pPage){ int *szCell; /* Local size of all cells in apCell[] */ u8 *aCopy[NB]; /* Space for holding data of apCopy[] */ u8 *aSpace; /* Space to hold copies of dividers cells */ -#ifndef SQLITE_OMIT_VACUUM +#ifndef SQLITE_OMIT_AUTOVACUUM u8 *aFrom = 0; #endif @@ -4227,7 +4227,6 @@ static int balance_shallower(MemPage *pPage){ int mxCellPerPage; /* Maximum number of cells per page */ u8 **apCell; /* All cells from pages being balanced */ int *szCell; /* Local size of all cells */ - int i; assert( pPage->pParent==0 ); assert( pPage->nCell==0 ); @@ -4357,6 +4356,7 @@ static int balance_deeper(MemPage *pPage){ zeroPage(pPage, pChild->aData[0] & ~PTF_LEAF); put4byte(&pPage->aData[pPage->hdrOffset+8], pgnoChild); TRACE(("BALANCE: copy root %d into %d\n", pPage->pgno, pChild->pgno)); +#ifndef SQLITE_OMIT_AUTOVACUUM if( pBt->autoVacuum ){ int i; rc = ptrmapPut(pBt, pChild->pgno, PTRMAP_BTREE, pPage->pgno); @@ -4368,6 +4368,7 @@ static int balance_deeper(MemPage *pPage){ } } } +#endif rc = balance_nonroot(pChild); releasePage(pChild); return rc; diff --git a/test/autovacuum_crash.test b/test/autovacuum_crash.test index d981d1af4..981cc4fef 100644 --- a/test/autovacuum_crash.test +++ b/test/autovacuum_crash.test @@ -12,10 +12,18 @@ # This file runs the tests in the file crash.test with auto-vacuum enabled # databases. # -# $Id: autovacuum_crash.test,v 1.1 2004/11/08 09:51:09 danielk1977 Exp $ +# $Id: autovacuum_crash.test,v 1.2 2005/01/16 09:06:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl + +# If this build of the library does not support auto-vacuum, omit this +# whole file. +ifcapable {!autovacuum} { + finish_test + return +} + rename finish_test really_finish_test2 proc finish_test {} {} set ISQUICK 1 diff --git a/test/autovacuum_ioerr.test b/test/autovacuum_ioerr.test index e7584443c..b76d760b1 100644 --- a/test/autovacuum_ioerr.test +++ b/test/autovacuum_ioerr.test @@ -12,10 +12,18 @@ # This file runs the tests in the file crash.test with auto-vacuum enabled # databases. # -# $Id: autovacuum_ioerr.test,v 1.1 2005/01/11 10:25:07 danielk1977 Exp $ +# $Id: autovacuum_ioerr.test,v 1.2 2005/01/16 09:06:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl + +# If this build of the library does not support auto-vacuum, omit this +# whole file. +ifcapable {!autovacuum} { + finish_test + return +} + rename finish_test really_finish_test2 proc finish_test {} {} set ISQUICK 1 diff --git a/test/autovacuum_ioerr2.test b/test/autovacuum_ioerr2.test index 584da274a..be02aff14 100644 --- a/test/autovacuum_ioerr2.test +++ b/test/autovacuum_ioerr2.test @@ -15,11 +15,18 @@ # The tests in this file use special facilities that are only # available in the SQLite test fixture. # -# $Id: autovacuum_ioerr2.test,v 1.2 2005/01/15 12:45:51 danielk1977 Exp $ +# $Id: autovacuum_ioerr2.test,v 1.3 2005/01/16 09:06:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl +# If this build of the library does not support auto-vacuum, omit this +# whole file. +ifcapable {!autovacuum} { + finish_test + return +} + proc opendb {} { catch {file delete -force test.db} catch {file delete -force test.db-journal} diff --git a/test/crash.test b/test/crash.test index 23865a286..afbddf895 100644 --- a/test/crash.test +++ b/test/crash.test @@ -20,7 +20,7 @@ # The special crash-test module with its os_test.c backend only works # on Unix. # -# $Id: crash.test,v 1.15 2005/01/15 12:45:51 danielk1977 Exp $ +# $Id: crash.test,v 1.16 2005/01/16 09:06:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -68,11 +68,6 @@ proc signature2 {} { return [db eval {SELECT count(*), md5sum(a), md5sum(b), md5sum(c) FROM abc2}] } -# This variable is set to 1 if the databases being used support auto-vacuum. -# This is because some of the tests in this file verify file-size, which is -# slightly larger for auto-vacuum databases. -set AUTOVACUUM [db eval {pragma auto_vacuum}] - #-------------------------------------------------------------------------- # Simple crash test: # @@ -350,7 +345,7 @@ do_test crash-5.1 { } {} do_test crash-5.2 { expr [file size test.db] / 1024 -} [expr $AUTOVACUUM ? 11 : 10] +} [expr [string match [execsql {pragma auto_vacuum}] 1] ? 11 : 10] set sig [signature] do_test crash-5.3 { # The SQL below is used to expose a bug that existed in @@ -427,9 +422,4 @@ do_test crash-7.2 { signature } $sig -# The AUTOVACUUM was changed above. We have to reset it for -# other scripts that run as part of "fulltest" -# -set AUTOVACUUM $sqlite_options(default_autovacuum) - finish_test diff --git a/test/ioerr.test b/test/ioerr.test index 489643c8c..63ed95dfa 100644 --- a/test/ioerr.test +++ b/test/ioerr.test @@ -15,13 +15,11 @@ # The tests in this file use special facilities that are only # available in the SQLite test fixture. # -# $Id: ioerr.test,v 1.13 2005/01/14 13:50:13 danielk1977 Exp $ +# $Id: ioerr.test,v 1.14 2005/01/16 09:06:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl -set ::AV [execsql {pragma auto_vacuum}] - # Usage: do_ioerr_test <test number> <options...> # # The first argument, <test number>, is an integer used to name the @@ -110,7 +108,7 @@ do_ioerr_test 1 -sqlprep { COMMIT; SELECT * FROM t1; DELETE FROM t1 WHERE a<100; -} -exclude [expr [execsql {pragma auto_vacuum}] ? 8 : 0] +} -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 8 : 0] proc cksum {{db db}} { @@ -228,7 +226,7 @@ do_ioerr_test 5 -sqlprep { CREATE TABLE t1(a,b,c); CREATE TABLE test2.t2(a,b,c); COMMIT; -} -exclude [expr [execsql {pragma auto_vacuum}] ? 8 : 0] +} -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 8 : 0] # Test IO errors when replaying two hot journals from a 2-file # transaction. This test only runs on UNIX. @@ -286,5 +284,3 @@ do_ioerr_test 14 -tclprep { finish_test - - diff --git a/test/misuse.test b/test/misuse.test index effe8bff0..e7cc08200 100644 --- a/test/misuse.test +++ b/test/misuse.test @@ -13,7 +13,7 @@ # This file implements tests for the SQLITE_MISUSE detection logic. # This test file leaks memory and file descriptors. # -# $Id: misuse.test,v 1.8 2004/11/14 21:56:31 drh Exp $ +# $Id: misuse.test,v 1.9 2005/01/16 09:06:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -40,6 +40,7 @@ proc catchsql2 {sql} { do_test misuse-1.1 { db close catch {file delete -force test2.db} + catch {file delete -force test2.db-journal} set ::DB [sqlite3 db test2.db] execsql { CREATE TABLE t1(a,b); |