mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix a bug in the btree code for reading varints greater than 2^32. (CVS 1349)
FossilOrigin-Name: 7bc4f5543fbfa9f3fe6e9479a1f85fbaf6c95af4
This commit is contained in:
18
manifest
18
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Update\sthe\smain.mk\smakefile\sso\sthat\sit\sbuilds\severything\sagain.\s(CVS\s1348)
|
C Fix\sa\sbug\sin\sthe\sbtree\scode\sfor\sreading\svarints\sgreater\sthan\s2^32.\s(CVS\s1349)
|
||||||
D 2004-05-11T01:18:25
|
D 2004-05-11T02:10:07
|
||||||
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 fa9a58234406d84eeb900517d0c0adc4b2da051a
|
F src/attach.c fa9a58234406d84eeb900517d0c0adc4b2da051a
|
||||||
F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79
|
F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79
|
||||||
F src/btree.c ac2de2cfaf183e15ae6e58e52530b37a7de02a0f
|
F src/btree.c 4e9ed30d1239e077d94efe3d6b9a5ee205e2f979
|
||||||
F src/btree.h 578dc465c801cf4e7666efbb0fa1c46a54758008
|
F src/btree.h 578dc465c801cf4e7666efbb0fa1c46a54758008
|
||||||
F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5
|
F src/btree_rb.c 9d7973e266ee6f9c61ce592f68742ce9cd5b10e5
|
||||||
F src/build.c 8d9965b3ce5dcc1bd4dac60bd0f14524fea269cb
|
F src/build.c 8d9965b3ce5dcc1bd4dac60bd0f14524fea269cb
|
||||||
@@ -54,7 +54,7 @@ F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2
|
|||||||
F src/tclsqlite.c a38bf2263a097fcc9603e818c291151de1782c11
|
F src/tclsqlite.c a38bf2263a097fcc9603e818c291151de1782c11
|
||||||
F src/test1.c 79956f70dddd1a28f8577bbd61c8cf28e5875eb8
|
F src/test1.c 79956f70dddd1a28f8577bbd61c8cf28e5875eb8
|
||||||
F src/test2.c 6195a1ca2c8d0d2d93644e86da3289b403486872
|
F src/test2.c 6195a1ca2c8d0d2d93644e86da3289b403486872
|
||||||
F src/test3.c e238a8ded4d7842cb369a7e03ab1fd0bcee5f15a
|
F src/test3.c 1b3ac2199169fb331685c7bef15ad54721db278b
|
||||||
F src/test4.c b3fab9aea7a8940a8a7386ce1c7e2157b09bd296
|
F src/test4.c b3fab9aea7a8940a8a7386ce1c7e2157b09bd296
|
||||||
F src/test5.c eb39aac8fed61bd930b92613cd705c145244074a
|
F src/test5.c eb39aac8fed61bd930b92613cd705c145244074a
|
||||||
F src/tokenize.c e7536dd31205d5afb76c1bdc832dea009c7a3847
|
F src/tokenize.c e7536dd31205d5afb76c1bdc832dea009c7a3847
|
||||||
@@ -63,7 +63,7 @@ F src/update.c 6ca82fc4a0fb4d7f134e961921c906f6f3c8bc74
|
|||||||
F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f
|
F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f
|
||||||
F src/util.c 74ee316594f68c41aed1884d737ab4085d479455
|
F src/util.c 74ee316594f68c41aed1884d737ab4085d479455
|
||||||
F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
||||||
F src/vdbe.c c6c763868eec22a5d7b23357a89fa7792cc9575b
|
F src/vdbe.c f2094463b65008ff5b21efb8fa9488166708415f
|
||||||
F src/vdbe.h 2dc4d1161b64f5684faa6a2d292e318a185ecb2e
|
F src/vdbe.h 2dc4d1161b64f5684faa6a2d292e318a185ecb2e
|
||||||
F src/vdbeInt.h d5786e1c4f7dadac24e3baeed9847dbfed3016de
|
F src/vdbeInt.h d5786e1c4f7dadac24e3baeed9847dbfed3016de
|
||||||
F src/vdbeaux.c 7162f1390620257e25070da1ac2b4ec83e472752
|
F src/vdbeaux.c 7162f1390620257e25070da1ac2b4ec83e472752
|
||||||
@@ -188,7 +188,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 a675ac49882887dfcbf671e9092a29aca9eb694e
|
P e6e52fc2e62835712d6b92a19fdbd2ba15b2e9cd
|
||||||
R e4298f2dca6b4eb015412d2c78eef0b6
|
R eddbe501e85ee40d9b6f98dd3f3ed5da
|
||||||
U drh
|
U danielk1977
|
||||||
Z e408df7d35442709fba413b4e2b48938
|
Z 09a8cec2758d5fe1ed56a8565010b716
|
||||||
|
@@ -1 +1 @@
|
|||||||
e6e52fc2e62835712d6b92a19fdbd2ba15b2e9cd
|
7bc4f5543fbfa9f3fe6e9479a1f85fbaf6c95af4
|
@@ -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.125 2004/05/11 00:58:56 drh Exp $
|
** $Id: btree.c,v 1.126 2004/05/11 02:10:07 danielk1977 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
|
||||||
@@ -309,7 +309,7 @@ static unsigned int getVarint(unsigned char *p, u64 *pResult){
|
|||||||
u64 x = p[0] & 0x7f;
|
u64 x = p[0] & 0x7f;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
while( (p[n++]&0x80)!=0 ){
|
while( (p[n++]&0x80)!=0 ){
|
||||||
x |= (p[n]&0x7f)<<(n*7);
|
x |= ((u64)(p[n]&0x7f))<<(n*7);
|
||||||
}
|
}
|
||||||
*pResult = x;
|
*pResult = x;
|
||||||
return n;
|
return n;
|
||||||
|
10
src/test3.c
10
src/test3.c
@@ -13,7 +13,7 @@
|
|||||||
** is not included in the SQLite library. It is used for automated
|
** is not included in the SQLite library. It is used for automated
|
||||||
** testing of the SQLite library.
|
** testing of the SQLite library.
|
||||||
**
|
**
|
||||||
** $Id: test3.c,v 1.35 2004/05/11 00:58:56 drh Exp $
|
** $Id: test3.c,v 1.36 2004/05/11 02:10:07 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "pager.h"
|
#include "pager.h"
|
||||||
@@ -686,8 +686,16 @@ static int btree_insert(
|
|||||||
}
|
}
|
||||||
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
|
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
|
||||||
if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
|
if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
|
||||||
|
/*
|
||||||
int iKey;
|
int iKey;
|
||||||
if( Tcl_GetInt(interp, argv[2], &iKey) ) return TCL_ERROR;
|
if( Tcl_GetInt(interp, argv[2], &iKey) ) return TCL_ERROR;
|
||||||
|
*/
|
||||||
|
i64 iKey;
|
||||||
|
Tcl_Obj *obj = Tcl_NewStringObj(argv[2], -1);
|
||||||
|
Tcl_IncrRefCount(obj);
|
||||||
|
if( Tcl_GetWideIntFromObj(interp, obj, &iKey) ) return TCL_ERROR;
|
||||||
|
Tcl_DecrRefCount(obj);
|
||||||
|
|
||||||
rc = sqlite3BtreeInsert(pCur, 0, iKey, argv[3], strlen(argv[3]));
|
rc = sqlite3BtreeInsert(pCur, 0, iKey, argv[3], strlen(argv[3]));
|
||||||
}else{
|
}else{
|
||||||
rc = sqlite3BtreeInsert(pCur, argv[2], strlen(argv[2]),
|
rc = sqlite3BtreeInsert(pCur, argv[2], strlen(argv[2]),
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
** in this file for details. If in doubt, do not deviate from existing
|
** in this file for details. If in doubt, do not deviate from existing
|
||||||
** commenting and indentation practices when changing or adding code.
|
** commenting and indentation practices when changing or adding code.
|
||||||
**
|
**
|
||||||
** $Id: vdbe.c,v 1.275 2004/05/11 00:28:43 danielk1977 Exp $
|
** $Id: vdbe.c,v 1.276 2004/05/11 02:10:07 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@@ -3211,7 +3211,8 @@ case OP_PutStrKey: {
|
|||||||
** the integer key, and zKey to NULL.
|
** the integer key, and zKey to NULL.
|
||||||
*/
|
*/
|
||||||
if( pC->intKey ){
|
if( pC->intKey ){
|
||||||
nKey = pNos->i;
|
nKey = intToKey(pNos->i);
|
||||||
|
assert( keyToInt(nKey)==pNos->i );
|
||||||
zKey = 0;
|
zKey = 0;
|
||||||
}else{
|
}else{
|
||||||
/* TODO: can this happen? zKey is not correctly byte-ordered here! */
|
/* TODO: can this happen? zKey is not correctly byte-ordered here! */
|
||||||
|
Reference in New Issue
Block a user