Fix a problem with B+trees. (CVS 1366)

FossilOrigin-Name: 64a75c4cd40f79c7b384bb2972922ff0c10212a4
This commit is contained in:
drh 2004-05-12 21:11:27 +00:00
parent 8b18dd4fb5
commit fc70e6fcec
4 changed files with 14 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Implement\sa\sB+tree\soption\s(all\sdata\sstored\son\sleaves).\s(CVS\s1365) C Fix\sa\sproblem\swith\sB+trees.\s(CVS\s1366)
D 2004-05-12T19:18:16 D 2004-05-12T21:11:27
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@ -23,7 +23,7 @@ F sqlite.def fc4f5734786fe4743cfe2aa98eb2da4b089edb5f
F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2 F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2
F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5 F src/attach.c c315c58cb16fd6e913b3bfa6412aedecb4567fa5
F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79 F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79
F src/btree.c dc347ebd014e4adff75bffe890eb771393fad6c1 F src/btree.c 09f5838dd0353b5a7439b677066e1f3a187b2a77
F src/btree.h 6f51ad0ffebfba71295fcacdbe86007512200050 F src/btree.h 6f51ad0ffebfba71295fcacdbe86007512200050
F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5 F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5
F src/build.c f25e4ac9f102efd70188bc09a459c2b461fe2135 F src/build.c f25e4ac9f102efd70188bc09a459c2b461fe2135
@ -79,7 +79,7 @@ F test/btree.test ed5781db83b6c1de02e62781d44915a9abe3450a
F test/btree2.test aa4a6d05b1ea90b1acaf83ba89039dd302a88635 F test/btree2.test aa4a6d05b1ea90b1acaf83ba89039dd302a88635
F test/btree4.test 3797b4305694c7af6828675b0f4b1424b8ca30e4 F test/btree4.test 3797b4305694c7af6828675b0f4b1424b8ca30e4
F test/btree5.test 13763ea0aa768dfbcef02d93b0711601e03f84b4 F test/btree5.test 13763ea0aa768dfbcef02d93b0711601e03f84b4
F test/btree6.test ebcd1b56d500f208fa58ffc8110b4ae56039c6f4 F test/btree6.test e33221c6fb10b26c0ca352c85574b8d5bc88cdc1
F test/capi2.test ec96e0e235d87b53cbaef3d8e3e0f8ccf32c71ca F test/capi2.test ec96e0e235d87b53cbaef3d8e3e0f8ccf32c71ca
F test/conflict.test 0911bb2f079046914a6e9c3341b36658c4e2103e F test/conflict.test 0911bb2f079046914a6e9c3341b36658c4e2103e
F test/copy.test f07ea8d60878da7a67416ab62f78e9706b9d3c45 F test/copy.test f07ea8d60878da7a67416ab62f78e9706b9d3c45
@ -191,7 +191,7 @@ F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604
F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da
F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
P fb3c80301441f0d255164578601439db3e0c7a61 P b8f70d17f06531269caa0a127efb2d25ad0f3e1c
R 8c6e7272f61fac86442d80d07609d870 R f511235dca0d03c381f4bc44142fa7f8
U drh U drh
Z 1129f764b16985b0218b1b152f1cd264 Z 005ea33a8639fedd11d1cc2c48596cad

View File

@ -1 +1 @@
b8f70d17f06531269caa0a127efb2d25ad0f3e1c 64a75c4cd40f79c7b384bb2972922ff0c10212a4

View File

@ -9,7 +9,7 @@
** May you share freely, never taking more than you give. ** May you share freely, never taking more than you give.
** **
************************************************************************* *************************************************************************
** $Id: btree.c,v 1.129 2004/05/12 19:18:16 drh Exp $ ** $Id: btree.c,v 1.130 2004/05/12 21:11:27 drh Exp $
** **
** This file implements a external (disk-based) database using BTrees. ** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to ** For a detailed discussion of BTrees, refer to
@ -1987,6 +1987,8 @@ int sqlite3BtreeMoveto(BtCursor *pCur, const void *pKey, i64 nKey, int *pRes){
} }
if( c==0 ){ if( c==0 ){
if( pPage->leafData && !pPage->leaf ){ if( pPage->leafData && !pPage->leaf ){
lwr = pCur->idx;
upr = lwr - 1;
break; break;
}else{ }else{
pCur->iMatch = c; pCur->iMatch = c;

View File

@ -13,7 +13,7 @@
# the B+tree tables. B+trees store all data on the leaves rather # the B+tree tables. B+trees store all data on the leaves rather
# that storing data with keys on interior nodes. # that storing data with keys on interior nodes.
# #
# $Id: btree6.test,v 1.1 2004/05/12 19:18:17 drh Exp $ # $Id: btree6.test,v 1.2 2004/05/12 21:11:27 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -112,8 +112,8 @@ for {set i 1} {$i<=100} {incr i} {
btree_integrity_check $b1 1 $tab btree_integrity_check $b1 1 $tab
} {} } {}
do_test btree6-1.$i.3 { do_test btree6-1.$i.3 {
random_deletes $cur 190 random_deletes $cur 90
incr cnt -190 incr cnt -90
check_table $cur $cnt check_table $cur $cnt
} {} } {}
do_test btree6-1.$i.4 { do_test btree6-1.$i.4 {