Fix two asserts in the btree logic so that they work correctly even for

maximum-size index entries for 32K and 64K pages.

FossilOrigin-Name: e127192d106bd7e036caacf01bf7725eeaa85dbe
This commit is contained in:
drh 2010-08-18 21:19:03 +00:00
parent 1b8f78ca57
commit e22e03e210
3 changed files with 21 additions and 11 deletions

View File

@ -1,5 +1,8 @@
C Updated\stests\sfor\sCLI.\s\sAdded\ssome\sbasic\stests\sfor\sthe\s.import\scommand.
D 2010-08-18T17:16:26
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Fix\stwo\sasserts\sin\sthe\sbtree\slogic\sso\sthat\sthey\swork\scorrectly\seven\sfor\nmaximum-size\sindex\sentries\sfor\s32K\sand\s64K\spages.
D 2010-08-18T21:19:04
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -113,7 +116,7 @@ F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
F src/backup.c 51d83300fe0baee39405c416ceb19a58ed30a8ed
F src/bitvec.c af50f1c8c0ff54d6bdb7a80e2fceca5a93670bef
F src/btmutex.c 96a12f50f7a17475155971a241d85ec5171573ff
F src/btree.c b1213572824331457d3fbebf0a06945b4765ad4f
F src/btree.c 3089d018fd27082952d79543e771f6bc8af0b0f7
F src/btree.h b4ba2fdf6b64c7c376bdfffa826af6b786b151d9
F src/btreeInt.h 5b034ff54800046cc5870605d683ac1f9134bd99
F src/build.c 0018d49629fc4807100c988dd191dd95e185bb38
@ -844,7 +847,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 56cc883d3af5574c9dafecef8aa96d1d05c01b83
R f8071fb87093491279a52abcb3066064
U shaneh
Z 27e86cf284ab8d3eda267dae6456bdb0
P d46567e5d75a2b9fe96d2a7a30708b2827a0d490
R d8d679ffa4745c8bf93b5e6b5825b960
U drh
Z 7f378ed449a1354042bf47ceab852b72
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFMbE5MoxKgR168RlERAm3gAJ9j3QLeVFJiXfvfSnsTlMhGqmvBSgCfTW3m
v1U06YCPq+T+CyTYAg08zFE=
=0zqd
-----END PGP SIGNATURE-----

View File

@ -1 +1 @@
d46567e5d75a2b9fe96d2a7a30708b2827a0d490
e127192d106bd7e036caacf01bf7725eeaa85dbe

View File

@ -2365,7 +2365,7 @@ static int lockBtree(BtShared *pBt){
** 9-byte nKey value
** 4-byte nData value
** 4-byte overflow page pointer
** So a cell consists of a 2-byte poiner, a header which is as much as
** So a cell consists of a 2-byte pointer, a header which is as much as
** 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow
** page pointer.
*/
@ -5968,7 +5968,7 @@ static int balance_nonroot(
szCell[nCell] = sz;
pTemp = &aSpace1[iSpace1];
iSpace1 += sz;
assert( sz<=pBt->pageSize/4 );
assert( sz<=pBt->maxLocal+23 );
assert( iSpace1<=pBt->pageSize );
memcpy(pTemp, apDiv[i], sz);
apCell[nCell] = pTemp+leafCorrection;
@ -6214,7 +6214,7 @@ static int balance_nonroot(
}
}
iOvflSpace += sz;
assert( sz<=pBt->pageSize/4 );
assert( sz<=pBt->maxLocal+23 );
assert( iOvflSpace<=pBt->pageSize );
insertCell(pParent, nxDiv, pCell, sz, pTemp, pNew->pgno, &rc);
if( rc!=SQLITE_OK ) goto balance_cleanup;