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:
10
src/test3.c
10
src/test3.c
@@ -13,7 +13,7 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** 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 "pager.h"
|
||||
@@ -686,8 +686,16 @@ static int btree_insert(
|
||||
}
|
||||
if( Tcl_GetInt(interp, argv[1], (int*)&pCur) ) return TCL_ERROR;
|
||||
if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
|
||||
/*
|
||||
int iKey;
|
||||
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]));
|
||||
}else{
|
||||
rc = sqlite3BtreeInsert(pCur, argv[2], strlen(argv[2]),
|
||||
|
Reference in New Issue
Block a user