-C Fix\san\sobscure\sb-tree\sbug\sthat\sapplied\sto\stransient\strees\sused\sfor\sIN(...)\sexpressions.\s(CVS\s3987)
-D 2007-05-12T09:30:47
+C Fix\sanother\svariant\sof\sthe\s"IN\s(...)"\sb-tree\sproblem.\s(CVS\s3988)
+D 2007-05-12T10:41:48
F Makefile.in 87b200ad9970907f76df734d29dff3d294c10935
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/analyze.c 4bbf5ddf9680587c6d4917e02e378b6037be3651
F src/attach.c ba628db0c2b6a362f036d017bf1196cdfe4ebb37
F src/auth.c 902f4722661c796b97f007d9606bd7529c02597f
-F src/btree.c f24b394e5f5b46fced3464c19ac623d0d92ccaa6
+F src/btree.c 0c2f9b06c90d7c59925c03153c9d47fd739c8ca5
F src/btree.h 1d527bf61ed176f980c34999d5793a0fd45dcf8c
F src/btreeInt.h cb3c0e9eb842d06079a62cdf3492c90c5db7ba75
F src/build.c 5789303291d40a1d37bfede83c1c769be22c88ab
F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a
F test/icu.test e6bfae7f625c88fd14df6f540fe835bdfc1e4329
F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d
-F test/in2.test d76a13877d9c445308f48a26db9ea25a6d77032f
+F test/in2.test b1f447f4f0f67e9f83ff931e7e2e30873f9ea055
F test/incrblob.test 7f82ae497364612aa17a37f77f12e01e2bee9f20
F test/incrblob_err.test 9dae0762ba4d73b516d176d091c6b2b16f625953
F test/incrvacuum.test f490c8ae86f2ecca622425d02e27d3119058cb21
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 2e80736d57fde55b112864d8b198a9a2fe0eaa38
-R c03758dd4b5f8ad6c12d156193f78eb7
+P 96c7232f8b208cd1c50063f7946bb6dbc386abd6
+R e2d831528bd9b1aa18f85c2d481b3b12
U danielk1977
-Z d455335e1335c1a2040ee8b7528b51b1
+Z 0924774789a8e6d243ad58907ec918b8
-96c7232f8b208cd1c50063f7946bb6dbc386abd6
\ No newline at end of file
+260338c4b2b18c9f4da8bc7fe3eda306dcaa4e38
\ No newline at end of file
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.380 2007/05/12 09:30:47 danielk1977 Exp $
+** $Id: btree.c,v 1.381 2007/05/12 10:41:48 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
memcpy(apCell[nCell], &pOld->aData[pOld->hdrOffset+8], 4);
}else{
assert( leafCorrection==4 );
+ if( szCell[nCell]<4 ){
+ /* Do not allow any cells smaller than 4 bytes. */
+ szCell[nCell] = 4;
+ }
}
nCell++;
}
# This file tests a special case in the b-tree code that can be
# hit by the "IN" operator (or EXISTS, NOT IN, etc.).
#
-# $Id: in2.test,v 1.1 2007/05/12 09:30:47 danielk1977 Exp $
+# $Id: in2.test,v 1.2 2007/05/12 10:41:48 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
}
} {}
+set ::N 2000
+
do_test in2-2 {
db transaction {
- for {set ::ii 0} {$::ii < 1000} {incr ::ii} {
+ for {set ::ii 0} {$::ii < $::N} {incr ::ii} {
execsql {INSERT INTO a VALUES($::ii, $::ii)}
}
- execsql {INSERT INTO a VALUES(1000, '')}
+ execsql {INSERT INTO a VALUES(4000, '')}
- for {set ::ii 0} {$::ii < 1000} {incr ::ii} {
- execsql {INSERT INTO a VALUES(NULL, 'x' || $::ii)}
+ for {set ::ii 0} {$::ii < $::N} {incr ::ii} {
+ set ::t [format "x%04d" $ii]
+ execsql {INSERT INTO a VALUES(NULL, $::t)}
}
}
} {}
#
# $::ii integers.
# a string of zero length.
-# 1000 short strings.
+# $::N short strings.
#
# Records are inserted in sorted order.
#
# clauses, as it is impossible for persistent b-trees (SQL tables +
# indices) to contain cells smaller than 4 bytes.
#
-for {set ::ii 3} {$::ii < 1000} {incr ::ii} {
+for {set ::ii 3} {$::ii < $::N} {incr ::ii} {
do_test in2-$::ii {
execsql {
- SELECT 1 IN (SELECT a FROM a WHERE (i < $::ii) OR (i >= 1000))
+ SELECT 1 IN (SELECT a FROM a WHERE (i < $::ii) OR (i >= $::N))
}
} {1}
}