Changes to get tests to pass with OMIT_VIRTUALTABLE. Ticket #1877. (CVS 3318)

FossilOrigin-Name: 60616496b7d97fdda99262e2bab25e625151e857
This commit is contained in:
drh 2006-06-28 18:18:09 +00:00
parent 2cc55698cd
commit 3765df48c3
7 changed files with 51 additions and 23 deletions

View File

@ -1,5 +1,5 @@
C Better\shandling\sof\sNULL\scolumn\snames.\s(CVS\s3317)
D 2006-06-27T20:39:04
C Changes\sto\sget\stests\sto\spass\swith\sOMIT_VIRTUALTABLE.\s\sTicket\s#1877.\s(CVS\s3318)
D 2006-06-28T18:18:09
F Makefile.in 9c2a76055c305868cc5f5b73e29a252ff3632c0a
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -62,7 +62,7 @@ F src/os_unix.c 17d91581a0ab478a06cb6f257b707a4c4a93e5a7
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c c6976ae50b61fb5b7dce399e578aa1865f02b84f
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c 7ef4c5098b378d81d3687919d9de99ea99bbb6bb
F src/pager.c 2ae998a64f98bc2fa14893e08537365865a09519
F src/pager.h 43f32f3847421f7502cfbb66f4eb2302b8033818
F src/parse.y e0831a269fbbd21414bb367fd0b806569c934683
F src/pragma.c 27d5e395c5d950931c7ac4fe610e7c2993e2fa55
@ -97,7 +97,7 @@ F src/update.c 951f95ef044cf6d28557c48dc35cb0711a0b9129
F src/utf.c ab81ac59084ff1c07d421eb1a0a84ec809603b44
F src/util.c 410adf9074b81c58e276a3dd5c1295ef6e5eeda4
F src/vacuum.c 5b37d0f436f8e1ffacd17934e44720b38d2247f9
F src/vdbe.c 77679f2e01cb7bbd5087dca96c79116b66119a8f
F src/vdbe.c 3ffc96ec2e870b3ab3e59d1f6fe34687e4ed1db6
F src/vdbe.h 258b5d1c0aaa72192f09ff0568ce42b383f156fa
F src/vdbeInt.h e3eaab262b67b84474625cfc38aec1125c32834b
F src/vdbeapi.c 6af0e7160af260052a7a4500464221a03dada75f
@ -173,7 +173,7 @@ F test/enc2.test 9f15cb7adc745fbb93d083ae1cf5a2deaa04d25f
F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030
F test/expr.test 7b4b349abdb05ab1862c1cfcf7607e3731efc5d2
F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce
F test/format4.test aec322535418f5e86b056bf4dfbcfb45bf09802e
F test/format4.test ddb875c0d423bb3fbe923d2ba89773d4afb5c46a
F test/func.test c0df82c29f07b8b6ee0aaa13950f43880f8046bf
F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a
F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
@ -264,7 +264,7 @@ F test/tkt1444.test a9d72f9e942708bd82dde6c707da61c489e213e9
F test/tkt1449.test 93584a449752d52b07d2cfc280a69842b6e16ed5
F test/tkt1473.test 9d000af3e11a4450d4c596f5e58b4b0d24eb0f8b
F test/tkt1501.test 2064f98e00871848af4b2f517e46c1a7fb2e32db
F test/tkt1512.test d8cd5f1c16103b5bc3ccf254731f63e69c364d1d
F test/tkt1512.test ec9a6d9f874a61b50e9fd62ef7947adef6c947ce
F test/tkt1514.test baa587a69fa2e8d575ebdaf1460f711281dcba49
F test/tkt1536.test 83ff7a7b6e248016f8d682d4f7a4ae114070d466
F test/tkt1537.test e3a14332de9770be8ff14bd15c19a49cbec10808
@ -298,7 +298,7 @@ F test/vtab2.test bd6d6f3dc0403f42a63a63e3319e0a689d27dd4f
F test/vtab3.test f38d6d7d19f08bffdadce4d5b8cba078f8118587
F test/vtab4.test 4b4293341443839ef6dc02f8d9e614702a6c67ff
F test/vtab5.test 9fb8f335651afe8f870011e2f68e5b00c5ad03cd
F test/vtab6.test 0b4fe07e421b2b9a334bec8781e75cbd8e230bd3
F test/vtab6.test ec0036f29f8a803da9935206f2d9d1b6a8026392
F test/vtab_err.test 11b90203ad60d63746d0de547b1ca014704d8f0e
F test/where.test ee7c9a6659b07e1ee61177f6e7ff71565ee2c9df
F test/where2.test a16476a5913e75cf65b38f2daa6157a6b7791394
@ -375,7 +375,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P eb3442c44ef1dbf8895195bb08fbeeea315b44c1
R 950547ff05ca6adfe4c9ef0816623482
P 9f13972b93a3cac95b4319d3e75343e02a30a38f
R 54c6672921ebefe1614738cd3c9704f9
U drh
Z 442e3d34de52d4352748481f67186145
Z e1fff001b97c51467fd6bfa672183691

View File

@ -1 +1 @@
9f13972b93a3cac95b4319d3e75343e02a30a38f
60616496b7d97fdda99262e2bab25e625151e857

View File

@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.269 2006/06/15 14:31:07 drh Exp $
** @(#) $Id: pager.c,v 1.270 2006/06/28 18:18:09 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@ -403,7 +403,12 @@ static void pager_resize_hash_table(Pager *pPager, int N){
pPager->nHash = N;
pPager->aHash = aHash;
for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){
int h = pPg->pgno & (N-1);
int h;
if( pPg->pgno==0 ){
assert( pPg->pNextHash==0 && pPg->pPrevHash==0 );
continue;
}
h = pPg->pgno & (N-1);
pPg->pNextHash = aHash[h];
if( aHash[h] ){
aHash[h]->pPrevHash = pPg;
@ -1856,7 +1861,7 @@ static int syncJournal(Pager*);
*/
static void unlinkHashChain(Pager *pPager, PgHdr *pPg){
if( pPg->pgno==0 ){
/* If the page number is zero, then this page is not in any hash chain. */
assert( pPg->pNextHash==0 && pPg->pPrevHash==0 );
return;
}
if( pPg->pNextHash ){
@ -1867,7 +1872,6 @@ static void unlinkHashChain(Pager *pPager, PgHdr *pPg){
pPg->pPrevHash->pNextHash = pPg->pNextHash;
}else{
int h = pPg->pgno & (pPager->nHash-1);
assert( pPager->aHash[h]==pPg );
pPager->aHash[h] = pPg->pNextHash;
}
if( MEMDB ){
@ -2795,6 +2799,7 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
/* Link the page into the page hash table */
h = pgno & (pPager->nHash-1);
assert( pgno!=0 );
pPg->pNextHash = pPager->aHash[h];
pPager->aHash[h] = pPg;
if( pPg->pNextHash ){
@ -3849,6 +3854,7 @@ int sqlite3pager_movepage(Pager *pPager, void *pData, Pgno pgno){
}
/* Change the page number for pPg and insert it into the new hash-chain. */
assert( pgno!=0 );
pPg->pgno = pgno;
h = pgno & (pPager->nHash-1);
if( pPager->aHash[h] ){

View File

@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.569 2006/06/24 11:51:34 danielk1977 Exp $
** $Id: vdbe.c,v 1.570 2006/06/28 18:18:09 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@ -3895,7 +3895,7 @@ case OP_IdxIsNull: { /* no-push */
case OP_Destroy: {
int iMoved;
Vdbe *pVdbe;
int iCnt = db->activeVdbeCnt;
int iCnt;
#ifndef SQLITE_OMIT_VIRTUALTABLE
iCnt = 0;
for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){
@ -3903,6 +3903,8 @@ case OP_Destroy: {
iCnt++;
}
}
#else
iCnt = db->activeVdbeCnt;
#endif
if( iCnt>1 ){
rc = SQLITE_LOCKED;
@ -3912,11 +3914,11 @@ case OP_Destroy: {
pTos++;
pTos->flags = MEM_Int;
pTos->i = iMoved;
#ifndef SQLITE_OMIT_AUTOVACUUM
#ifndef SQLITE_OMIT_AUTOVACUUM
if( rc==SQLITE_OK && iMoved!=0 ){
sqlite3RootPageMoved(&db->aDb[pOp->p2], iMoved, pOp->p1);
}
#endif
#endif
}
break;
}

View File

@ -22,6 +22,17 @@ ifcapable legacyformat {
return
}
# The size of the database depends on whether or not autovacuum
# is enabled.
#
if {[db one {PRAGMA auto_vacuum}]} {
set small 3072
set large 5120
} else {
set small 2048
set large 4096
}
do_test format4-1.1 {
execsql {
CREATE TABLE t1(x0,x1,x2,x3,x4,x5,x6,x7,x8,x9);
@ -34,19 +45,19 @@ do_test format4-1.1 {
INSERT INTO t1 SELECT * FROM t1;
}
file size test.db
} {2048}
} $small
do_test format4-1.2 {
execsql {
UPDATE t1 SET x0=1, x1=1, x2=1, x3=1, x4=1, x5=1, x6=1, x7=1, x8=1, x9=1
}
file size test.db
} {2048}
} $small
do_test format4-1.3 {
execsql {
UPDATE t1 SET x0=2, x1=2, x2=2, x3=2, x4=2, x5=2, x6=2, x7=2, x8=2, x9=2
}
file size test.db
} {4096}
} $large
finish_test

View File

@ -21,6 +21,10 @@ ifcapable !vacuum {
finish_test
return
}
if {[db one {PRAGMA auto_vacuum}]} {
finish_test
return
}
do_test tkt1512-1.1 {
execsql {

View File

@ -14,11 +14,16 @@
# virtual tables. The test cases in this file are copied from the file
# join.test, and some of the comments still reflect that.
#
# $Id: vtab6.test,v 1.1 2006/06/21 07:02:34 danielk1977 Exp $
# $Id: vtab6.test,v 1.2 2006/06/28 18:18:10 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !vtab {
finish_test
return
}
register_echo_module [sqlite3_connection_pointer db]
execsql {