diff --git a/manifest b/manifest index 3539df3f2f..c352386d74 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Support\sroot-page\sallocation/deallocation\sin\sauto-vacuum\sdatabases.\sStill\sa\sfew\sproblems.\s(CVS\s2054) -D 2004-11-04T14:30:05 +C All\stests\spass\swhen\sSQLITE_OMIT_INTEGRITY_CHECK\sis\sdefined.\s(CVS\s2055) +D 2004-11-04T14:47:12 F Makefile.in c4d2416860f472a1e3393714d0372074197565df F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1 @@ -31,7 +31,7 @@ F src/attach.c e49d09dad9f5f9fb10b4b0c1be5a70ae4c45e689 F src/auth.c 3b81f2a42f48a62c2c9c9b0eda31a157c681edea F src/btree.c a3e45d54eb1a81698f609693c22df382dfbf9151 F src/btree.h 3166388fa58c5594d8064d38b43440d79da38fb6 -F src/build.c 89d1ace10837e61d11cf9818750d8782369ac3f5 +F src/build.c 1bf89a574108cbb03aed722f0ce97cf54469717d F src/date.c 34bdb0082db7ec2a83ef00063f7b44e61ee19dad F src/delete.c 52980e594e69e80374fb928fe611d5f75ca4e390 F src/expr.c 3a43e508a3dc213703808bbcbb17633b88b57d17 @@ -66,7 +66,7 @@ F src/table.c 25b3ff2b39b7d87e8d4a5da0713d68dfc06cbee9 F src/tclsqlite.c 0302e3f42f015d132d1291f3388c06e86c24a008 F src/test1.c df1d1ca2c40cafefb9a29860f072c4d0fee1a7b5 F src/test2.c b11fa244fff02190707dd0879987c37c75e61fc8 -F src/test3.c b6aece10ee51579d0f75d09137b3c94c80b3c278 +F src/test3.c fdae1ed48add4b5df60f59a7c22e9d0b34265b55 F src/test4.c 7c6b9fc33dd1f3f93c7f1ee6e5e6d016afa6c1df F src/test5.c b001fa7f1b9e2dc5c2331de62fc641b5ab2bd7a1 F src/tokenize.c bf9de9689b3bb813d65784bf54472804bf9595e6 @@ -83,7 +83,7 @@ F src/vdbeaux.c 544ff66308d3184b519decc731abb65c5233bc2d F src/vdbemem.c ef9ac7d32acfe4bce5c5b408b1294c8d9e0cdb56 F src/where.c 6e637a6b3e61fe3104adc4e5caa4738bf6570daa F test/all.test 929bfa932b55e75c96fe2203f7650ba451c1862c -F test/attach.test ff7fc16b4518a448fed47dfb3694bf57f522d552 +F test/attach.test e305dd59a375e37c658c6d401f19f8a95880bf9a F test/attach2.test f7795123d3051ace1672b6d23973da6435de3745 F test/attach3.test 742c932d7130e0e699a5d9f265cb831e0a824633 F test/auth.test 1cc252d9e7b3bdc1314199cbf3a0d3c5ed026c21 @@ -97,13 +97,13 @@ F test/btree2.test aa4a6d05b1ea90b1acaf83ba89039dd302a88635 F test/btree4.test 3797b4305694c7af6828675b0f4b1424b8ca30e4 F test/btree5.test 8e5ff32c02e685d36516c6499add9375fe1377f2 F test/btree6.test a5ede6bfbbb2ec8b27e62813612c0f28e8f3e027 -F test/btree7.test 429b96cfef5b51a7d512cfb4b5b3e453384af293 +F test/btree7.test a6d3b842db22af97dd14b989e90a2fd96066b72f F test/capi2.test 1ec97bf8896185aec2366c7d07b01edef6ae4b7e F test/capi3.test 9258ca75fc98d89477015dcd70aa3d2757b142b8 F test/capi3b.test 5b6a66f9f295f79f443b5d3f33187fa5ef6cf336 F test/collate1.test f79736d2ebf5492167ee4d1f4ab4c09dda776b03 F test/collate2.test 12fd658d8f5106a8a5c8a77d66919d8c89394036 -F test/collate3.test e60b428e07ec945492ba90ff1c895902ee3a8a50 +F test/collate3.test ef53bf9323ebae7c75b6411e62a227dda81b9f7b F test/collate4.test c29c8d4b66cf45b36fa112c28493cdb451a8409b F test/collate5.test 1dd5f0f508c46667f9d4606c7950c414b0bdc0d5 F test/collate6.test 6c9470d1606ee3e564675b229653e320c49ec638 @@ -113,7 +113,7 @@ F test/crash.test a3f6d27f7cb7f7bd752461db1e14f7c781ecedc3 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/date.test dda578ec1857837156bd8b32f8e09d81d7d7881c F test/delete.test fc29491f6a7ac899ce29f4549a104809e245d9a6 -F test/delete2.test 050a3a6e8ea0f83aed817d164b16af2a499fb452 +F test/delete2.test 1d3f99f52f50eb6ed10c803f80540a6857307a7d F test/diskfull.test e2f6cfd868713ead06dc82b84a4938e868128fc0 F test/enc.test 2f5463af488d50aef60c6110bec6b21b5efba961 F test/enc2.test 7a60971a62748be6b607b4b4380eb4c5e151a6ec @@ -141,21 +141,21 @@ F test/lock2.test 2213590d442147d09fd2334c905a755586c1c398 F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9 F test/main.test 5f9deae11b93336da1ccc5f91cf8be075c91ddf1 F test/malloc.test 769b240d89a7ef3320d88919fdb6765f9395a51f -F test/memdb.test b8a13fa79f006bd087bbcf135ce8eb62056a6027 +F test/memdb.test 34ee8598de307a16ccc3ac91b85cee9c668ae5ed F test/memleak.test f1fa233f8295dd1d955a00d5e5ee857850f27f29 F test/minmax.test c0f92d3f7b11656221735385f2c8b1878bbbdaf6 F test/misc1.test 744f60d1025fa978708b96cb222a07a1feb1524a F test/misc2.test 9d9403f7e6092699f3f92bb1e26ff55165528e7c -F test/misc3.test 8c83c3810d6254d9d63b4cbf3941c7b9523c236d +F test/misc3.test 928a2f1e1189924ed14e1ae074e34f40688bdf94 F test/misc4.test d005a75f095bb04db09a5d096144405ae566b622 F test/misuse.test fcd9e7cec6ecccc34822584aec6b4e31f13629e1 F test/notnull.test 7a08117a71e74b0321aaa937dbeb41a09d6eb1d0 F test/null.test 642428b6a5408cc5b954b49e1b6e5025e4458b2b F test/pager.test 394455707a079804e8a4e431d12edce831a065f0 F test/pager2.test c7e731ac56a2984a605b032ffd19b9deee820377 -F test/pager3.test 16f546293bb751b8151dc17df613fca938bbec8b +F test/pager3.test 647f696a9cf7409df00a1e0047c2eb55585a1b85 F test/pagesize.test 2050bb574c43f9143d283d6bcd37fa1eb73f0e49 -F test/pragma.test ed8156b5ef3a82ff7be6bd814b3715079ea5a6b0 +F test/pragma.test bde1271384bc415af04d9dd736c073cf7ef33177 F test/printf.test 92ba4c510b4fc61120ffa4a01820446ed917ae57 F test/progress.test 5ddba78cb6011fba36093973cfb3ac473b8fb96a x F test/quick.test 2dca186ebd5c418a7699944ba3b5e437d765eddd @@ -182,7 +182,7 @@ F test/threadtest2.c 97a830d53c24c42290501fdfba4a6e5bdd34748b F test/trace.test a54fa8df0d01cf827289a7659d78959e8fd2f955 F test/trans.test 29645b344d2b9b6792793562b12340177ddd8f96 F test/trigger1.test 63a74ae12bccac86036f1c4f8f952fb0cf80703f -F test/trigger2.test fec8f9091ff1248eafb5a33690ad4ff7615f5215 +F test/trigger2.test cbf5da84a2413380644bde3fef94943ee103ea4e F test/trigger3.test f1c0cc1365f00b21a8cd41c189edca139c2d6cc6 F test/trigger4.test ce5c97aba6a8a11be5820e694659438c3e982ada F test/trigger5.test 619391a3e9fc194081d22cefd830d811e7badf83 @@ -252,7 +252,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0 F www/whentouse.tcl fdacb0ba2d39831e8a6240d05a490026ad4c4e4c -P c33b3a613751057e8a46fdcd428b8448329d414d -R 904dc0805c4ad385b004eaf63c77188e -U danielk1977 -Z d7dc31bf4e5f4e3f4969266ba871dca0 +P 1da361fae82d420be63c53f8e3efaccac24f348a +R 91d65eb4622d90500501298966d2317c +U drh +Z aa82f4ff31655559fe92ab11f9dd6086 diff --git a/manifest.uuid b/manifest.uuid index 780cdb4cdb..74c7122a9d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1da361fae82d420be63c53f8e3efaccac24f348a \ No newline at end of file +158a2d16a8630e3b5892120f6ea68f2b0dc47eb3 \ No newline at end of file diff --git a/src/build.c b/src/build.c index 027ae58c07..b88f7de8ee 100644 --- a/src/build.c +++ b/src/build.c @@ -23,7 +23,7 @@ ** ROLLBACK ** PRAGMA ** -** $Id: build.c,v 1.259 2004/11/04 14:30:05 danielk1977 Exp $ +** $Id: build.c,v 1.260 2004/11/04 14:47:12 drh Exp $ */ #include "sqliteInt.h" #include @@ -279,8 +279,7 @@ void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){ sqlite3HashClear(&pDb->aFKey); sqlite3HashClear(&pDb->idxHash); for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ - Trigger *pTrigger = sqliteHashData(pElem); - sqlite3DeleteTrigger(pTrigger); + sqlite3DeleteTrigger((Trigger*)sqliteHashData(pElem)); } sqlite3HashClear(&temp2); sqlite3HashInit(&pDb->tblHash, SQLITE_HASH_STRING, 0); @@ -1591,9 +1590,6 @@ void sqlite3RootPageMoved(Db *pDb, int iFrom, int iTo){ static void destroyRootPage(Vdbe *v, int iTable, int iDb){ #ifndef SQLITE_OMIT_AUTOVACUUM int base; -#endif - sqlite3VdbeAddOp(v, OP_Destroy, iTable, iDb); -#ifndef SQLITE_OMIT_AUTOVACUUM /* If SQLITE_OMIT_AUTOVACUUM is not defined, then OP_Destroy pushes ** an integer onto the stack. If this integer is non-zero, then it is ** the root page number of a table moved to location iTable. The @@ -1630,7 +1626,10 @@ static void destroyRootPage(Vdbe *v, int iTable, int iDb){ { OP_MakeRecord, 5, 0, 0}, { OP_PutIntKey, 0, 0, 0} /* 16 */ }; +#endif + sqlite3VdbeAddOp(v, OP_Destroy, iTable, iDb); +#ifndef SQLITE_OMIT_AUTOVACUUM base = sqlite3VdbeAddOpList(v, ArraySize(updateMaster), updateMaster); sqlite3VdbeChangeP1(v, base+13, iTable); #endif @@ -1839,8 +1838,8 @@ void sqlite3CreateForeignKey( ExprList *pToCol, /* Columns in the other table */ int flags /* Conflict resolution algorithms. */ ){ - FKey *pFKey = 0; #ifndef SQLITE_OMIT_FOREIGN_KEY + FKey *pFKey = 0; Table *p = pParse->pNewTable; int nByte; int i; diff --git a/src/test3.c b/src/test3.c index fc443e63f9..9c8b566874 100644 --- a/src/test3.c +++ b/src/test3.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test3.c,v 1.54 2004/11/04 14:30:06 danielk1977 Exp $ +** $Id: test3.c,v 1.55 2004/11/04 14:47:12 drh Exp $ */ #include "sqliteInt.h" #include "pager.h" @@ -562,10 +562,10 @@ static int btree_integrity_check( const char **argv /* Text of each argument */ ){ Btree *pBt; - char *zResult; int nRoot; int *aRoot; int i; + char *zResult; if( argc<3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], @@ -581,7 +581,7 @@ static int btree_integrity_check( #ifndef SQLITE_OMIT_INTEGRITY_CHECK zResult = sqlite3BtreeIntegrityCheck(pBt, aRoot, nRoot); #else - zResult = "ok"; + zResult = 0; #endif if( zResult ){ Tcl_AppendResult(interp, zResult, 0); diff --git a/test/attach.test b/test/attach.test index f18dd6eac6..bc745e38e4 100644 --- a/test/attach.test +++ b/test/attach.test @@ -12,7 +12,7 @@ # focus of this script is testing the ATTACH and DETACH commands # and related functionality. # -# $Id: attach.test,v 1.28 2004/11/04 04:42:28 drh Exp $ +# $Id: attach.test,v 1.29 2004/11/04 14:47:13 drh Exp $ # set testdir [file dirname $argv0] @@ -153,6 +153,7 @@ do_test attach-1.20.1 { db_list db } {0 main 2 db2 3 db3 4 db4 5 db6 6 db7 7 db8 8 db9 9 db10 10 db11} integrity_check attach-1.20.2 +execsql {select * from sqlite_temp_master} do_test attach-1.21 { catchsql { ATTACH 'test.db' as db12; diff --git a/test/btree7.test b/test/btree7.test index 7809f3e48d..eaf37138e1 100644 --- a/test/btree7.test +++ b/test/btree7.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is btree database backend. # -# $Id: btree7.test,v 1.1 2004/06/05 00:01:46 drh Exp $ +# $Id: btree7.test,v 1.2 2004/11/04 14:47:13 drh Exp $ set testdir [file dirname $argv0] @@ -39,20 +39,12 @@ do_test btree7-1.1 { INSERT INTO t1 VALUES(9, '$bigdata'); " } {} -#puts [execsql {select * from sqlite_master}] -#set bt [btree_open test.db 2000 0] -#btree_tree_dump $bt 2 -do_test btree7-1.2 { - execsql {PRAGMA integrity_check} -} {ok} +integrity_check btree7-1.2 do_test btree7-1.3 { execsql " INSERT INTO t1 VALUES(4, '$bigdata'); " } {} -#btree_tree_dump $bt 2 -do_test btree7-1.4 { - execsql {PRAGMA integrity_check} -} {ok} +integrity_check btree7-1.4 finish_test diff --git a/test/collate3.test b/test/collate3.test index 69ffb6cbe7..c442f1adc2 100644 --- a/test/collate3.test +++ b/test/collate3.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is page cache subsystem. # -# $Id: collate3.test,v 1.3 2004/06/19 00:16:31 drh Exp $ +# $Id: collate3.test,v 1.4 2004/11/04 14:47:13 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -221,11 +221,13 @@ do_test collate3-3.6 { DELETE FROM collate3t1; } } {0 {}} -do_test collate3-3.8 { - catchsql { - PRAGMA integrity_check - } -} {1 {no such collation sequence: string_compare}} +ifcapable {integrityck} { + do_test collate3-3.8 { + catchsql { + PRAGMA integrity_check + } + } {1 {no such collation sequence: string_compare}} +} do_test collate3-3.9 { catchsql { SELECT * FROM collate3t1; diff --git a/test/delete2.test b/test/delete2.test index 597ae0f238..064da17f77 100644 --- a/test/delete2.test +++ b/test/delete2.test @@ -29,7 +29,7 @@ # The solution to the problem was to detect that the table is locked # before the index entry is deleted. # -# $Id: delete2.test,v 1.1 2004/08/08 19:43:30 drh Exp $ +# $Id: delete2.test,v 1.2 2004/11/04 14:47:13 drh Exp $ # set testdir [file dirname $argv0] @@ -55,11 +55,7 @@ do_test delete2-1.2 { SELECT * FROM q WHERE id='id.1'; } } {hello id.1} -do_test delete2-1.3 { - execsql { - PRAGMA integrity_check - } -} ok +integrity_check delete2-1.3 # Start a query on the table. The query should not use the index. # Do not complete the query, thus leaving the table locked. @@ -68,9 +64,7 @@ do_test delete2-1.4 { set STMT [sqlite3_prepare $DB {SELECT * FROM q} -1 TAIL] sqlite3_step $STMT } SQLITE_ROW -do_test delete2-1.5 { - execsql {PRAGMA integrity_check} -} {ok} +integrity_check delete2-1.5 # Try to delete a row from the table. The delete should fail. # @@ -79,9 +73,7 @@ do_test delete2-1.6 { DELETE FROM q WHERE rowid=1 } } {1 {database table is locked}} -do_test delete2-1.7 { - execsql {PRAGMA integrity_check} -} {ok} +integrity_check delete2-1.7 do_test delete2-1.8 { execsql { SELECT * FROM q; @@ -97,9 +89,7 @@ do_test delete2-1.9 { DELETE FROM q WHERE rowid=1 } } {0 {}} -do_test delete2-1.10 { - execsql {PRAGMA integrity_check} -} {ok} +integrity_check delete2-1.10 do_test delete2-1.11 { execsql { SELECT * FROM q; diff --git a/test/memdb.test b/test/memdb.test index 5519b7d53c..57dd7cde5e 100644 --- a/test/memdb.test +++ b/test/memdb.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is in-memory database backend. # -# $Id: memdb.test,v 1.9 2004/06/19 00:16:31 drh Exp $ +# $Id: memdb.test,v 1.10 2004/11/04 14:47:13 drh Exp $ set testdir [file dirname $argv0] @@ -111,11 +111,7 @@ for {set i 2} {$i<=$limit} {incr i} { set ::pager_old_format 0 } -do_test memdb-2.1 { - execsql { - PRAGMA integrity_check - } -} {ok} +integrity_check memdb-2.1 do_test memdb-3.1 { execsql { diff --git a/test/misc3.test b/test/misc3.test index 77ad6f7796..41851880c4 100644 --- a/test/misc3.test +++ b/test/misc3.test @@ -13,7 +13,7 @@ # This file implements tests for miscellanous features that were # left out of other test files. # -# $Id: misc3.test,v 1.14 2004/11/04 04:42:28 drh Exp $ +# $Id: misc3.test,v 1.15 2004/11/04 14:47:13 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -106,33 +106,31 @@ do_test misc3-2.9 { # Ticket #522. Make sure integer overflow is handled properly in # indices. # -do_test misc3-3.1 { - execsql {PRAGMA integrity_check} -} ok +integrity_check misc3-3.1 do_test misc3-3.2 { execsql { CREATE TABLE t2(a INT UNIQUE); - PRAGMA integrity_check; } -} ok +} {} +integrity_check misc3-3.2.1 do_test misc3-3.3 { execsql { INSERT INTO t2 VALUES(2147483648); - PRAGMA integrity_check; } -} ok +} {} +integrity_check misc3-3.3.1 do_test misc3-3.4 { execsql { INSERT INTO t2 VALUES(-2147483649); - PRAGMA integrity_check; } -} ok +} {} +integrity_check misc3-3.4.1 do_test misc3-3.5 { execsql { INSERT INTO t2 VALUES(+2147483649); - PRAGMA integrity_check; } -} ok +} {} +integrity_check misc3-3.5.1 do_test misc3-3.6 { execsql { INSERT INTO t2 VALUES(+2147483647); diff --git a/test/pager3.test b/test/pager3.test index cfee6b6f49..9c3b6e1669 100644 --- a/test/pager3.test +++ b/test/pager3.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is page cache subsystem. # -# $Id: pager3.test,v 1.1 2004/08/18 19:09:44 drh Exp $ +# $Id: pager3.test,v 1.2 2004/11/04 14:47:13 drh Exp $ set testdir [file dirname $argv0] @@ -59,10 +59,13 @@ do_test pager3-1.1 { } db close sqlite3 db test.db - execsql { - pragma integrity_check; + set r ok + ifcapable {integrityck} { + set r [execsql { + pragma integrity_check; + }] } + set r } ok - finish_test diff --git a/test/pragma.test b/test/pragma.test index feba92e33a..1ab2214431 100644 --- a/test/pragma.test +++ b/test/pragma.test @@ -12,7 +12,7 @@ # # This file implements tests for the PRAGMA command. # -# $Id: pragma.test,v 1.20 2004/11/03 16:27:02 drh Exp $ +# $Id: pragma.test,v 1.21 2004/11/04 14:47:13 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -220,7 +220,7 @@ do_test pragma-3.1 { SELECT rowid, * from t2; } } {1 11 2 3 2 22 3 4} -if {![sqlite3 -has-codec]} { +if {![sqlite3 -has-codec] && $sqlite_options(integrityck)} { do_test pragma-3.2 { set rootpage [execsql {SELECT rootpage FROM sqlite_master WHERE name='i2'}] set db [btree_open test.db 100 0] @@ -307,6 +307,7 @@ catchsql {COMMIT;} # do_test pragma-6.1 { set res {} + execsql {SELECT * FROM sqlite_temp_master} foreach {idx name file} [execsql {pragma database_list}] { lappend res $idx $name } diff --git a/test/trigger2.test b/test/trigger2.test index d24e801056..ee4f5be6e6 100644 --- a/test/trigger2.test +++ b/test/trigger2.test @@ -193,11 +193,7 @@ foreach tbl_defn { } [list 1 0 0 0.0 0.0 5 6 \ 2 0 0 5.0 6.0 5 6 ] - do_test trigger2-1.$ii.4 { - execsql { - PRAGMA integrity_check; - } - } {ok} + integrity_check trigger2-1.$ii.4 } catchsql { DROP TABLE rlog; @@ -315,12 +311,7 @@ foreach tr_program { do_test trigger2-2.$ii-after "execsql {$statement $query}" $after_data execsql "DROP TRIGGER the_trigger;" - do_test trigger2-2.$ii-integrity { - execsql { - PRAGMA integrity_check; - } - } {ok} - + integrity_check trigger2-2.$ii-integrity } } catchsql { @@ -391,11 +382,7 @@ execsql { DROP TABLE tbl; DROP TABLE log; } -do_test trigger2-3.3 { - execsql { - PRAGMA integrity_check; - } -} {ok} +integrity_check trigger2-3.3 # Simple cascaded trigger execsql { @@ -723,8 +710,6 @@ do_test trigger2-8.6 { } } {3 103 5 205 4 304 9 109 11 211 10 310} -do_test trigger2-9.9 { - execsql {PRAGMA integrity_check} -} {ok} +integrity_check trigger2-9.9 finish_test