aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tclsqlite.c4
-rw-r--r--src/test1.c10
-rw-r--r--src/util.c4
-rw-r--r--src/vdbe.c29
-rw-r--r--src/vdbeaux.c6
5 files changed, 31 insertions, 22 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index 2c3b9211d..5d880f80e 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.64 2004/05/10 10:34:53 danielk1977 Exp $
+** $Id: tclsqlite.c,v 1.65 2004/05/11 06:17:22 danielk1977 Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -1208,7 +1208,7 @@ int TCLSH_MAIN(int argc, char **argv){
extern int Sqlitetest4_Init(Tcl_Interp*);
extern int Sqlitetest5_Init(Tcl_Interp*);
extern int Md5_Init(Tcl_Interp*);
-/* Sqlitetest1_Init(interp); */
+ Sqlitetest1_Init(interp);
Sqlitetest2_Init(interp);
Sqlitetest3_Init(interp);
/* Sqlitetest4_Init(interp); */
diff --git a/src/test1.c b/src/test1.c
index 109beb979..22f4587f8 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test1.c,v 1.38 2004/05/10 10:34:53 danielk1977 Exp $
+** $Id: test1.c,v 1.39 2004/05/11 06:17:22 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -1010,13 +1010,13 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
}
- Tcl_LinkVar(interp, "sqlite3_search_count",
+ Tcl_LinkVar(interp, "sqlite_search_count",
(char*)&sqlite3_search_count, TCL_LINK_INT);
- Tcl_LinkVar(interp, "sqlite3_interrupt_count",
+ Tcl_LinkVar(interp, "sqlite_interrupt_count",
(char*)&sqlite3_interrupt_count, TCL_LINK_INT);
- Tcl_LinkVar(interp, "sqlite3_open_file_count",
+ Tcl_LinkVar(interp, "sqlite_open_file_count",
(char*)&sqlite3_open_file_count, TCL_LINK_INT);
- Tcl_LinkVar(interp, "sqlite3_current_time",
+ Tcl_LinkVar(interp, "sqlite_current_time",
(char*)&sqlite3_current_time, TCL_LINK_INT);
Tcl_LinkVar(interp, "sqlite_static_bind_value",
(char*)&sqlite_static_bind_value, TCL_LINK_STRING);
diff --git a/src/util.c b/src/util.c
index 3052116bb..5524245d9 100644
--- a/src/util.c
+++ b/src/util.c
@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
-** $Id: util.c,v 1.79 2004/05/10 10:35:00 danielk1977 Exp $
+** $Id: util.c,v 1.80 2004/05/11 06:17:22 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -1148,7 +1148,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
u64 x = p[0] & 0x7f;
int n = 0;
while( (p[n++]&0x80)!=0 ){
- x |= (p[n]&0x7f)<<(n*7);
+ x |= ((u64)(p[n]&0x7f))<<(n*7);
}
*v = x;
return n;
diff --git a/src/vdbe.c b/src/vdbe.c
index b7d0f1559..44282df3e 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.277 2004/05/11 04:54:49 danielk1977 Exp $
+** $Id: vdbe.c,v 1.278 2004/05/11 06:17:22 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -2245,8 +2245,8 @@ case OP_MakeRecord: {
**
** Convert the top P1 entries of the stack into a single entry suitable
** for use as the key in an index. In addition, take one additional integer
-** off of the stack, treat that integer as a four-byte record number, and
-** append the four bytes to the key. Thus a total of P1+1 entries are
+** off of the stack, treat that integer as an eight-byte record number, and
+** append the integer to the key. Thus a total of P1+1 entries are
** popped from the stack for this instruction and a single entry is pushed
** back. The first P1 entries that are popped are strings and the last
** entry (the lowest on the stack) is an integer record number.
@@ -2319,7 +2319,7 @@ case OP_MakeKey: {
rc = SQLITE_TOOBIG;
goto abort_due_to_error;
}
- if( addRowid ) nByte += sizeof(u32);
+ if( addRowid ) nByte += sizeof(i64);
if( nByte<=NBFS ){
zNewKey = zTemp;
}else{
@@ -2344,12 +2344,13 @@ case OP_MakeKey: {
}
}
if( addRowid ){
- u32 iKey;
+ i64 iKey;
pRec = &pTos[-nField];
assert( pRec>=p->aStack );
Integerify(pRec);
+ /* TODO */
iKey = intToKey(pRec->i);
- memcpy(&zNewKey[j], &iKey, sizeof(u32));
+ memcpy(&zNewKey[j], &iKey, sizeof(i64));
popStack(&pTos, nField+1);
if( pOp->p2 && containsNull ) pc = pOp->p2 - 1;
}else{
@@ -3355,7 +3356,10 @@ case OP_RowData: {
pTos->flags = MEM_Null;
break;
}else if( pC->keyAsData || pOp->opcode==OP_RowKey ){
- /* TODO: sqlite3BtreeKeySize(pCrsr, &n); */
+ i64 n64;
+ assert( !pC->intKey );
+ sqlite3BtreeKeySize(pCrsr, &n64);
+ n = n64;
}else{
sqlite3BtreeDataSize(pCrsr, &n);
}
@@ -3804,14 +3808,15 @@ case OP_IdxRecno: {
assert( i>=0 && i<p->nCursor );
pTos++;
if( (pCrsr = p->aCsr[i].pCursor)!=0 ){
- int v;
- int sz;
+ i64 v;
+ u64 sz;
assert( p->aCsr[i].deferredMoveto==0 );
- /* TODO: sqlite3BtreeKeySize(pCrsr, &sz); */
- if( sz<sizeof(u32) ){
+ assert( p->aCsr[i].intKey==0 );
+ sqlite3BtreeKeySize(pCrsr, &sz);
+ if( sz<sizeof(i64) ){
pTos->flags = MEM_Null;
}else{
- sqlite3BtreeKey(pCrsr, sz - sizeof(u32), sizeof(u32), (char*)&v);
+ sqlite3BtreeKey(pCrsr, sz - sizeof(i64), sizeof(i64), (char*)&v);
v = keyToInt(v);
pTos->i = v;
pTos->flags = MEM_Int;
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 16ff2d719..f58bbef54 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1048,7 +1048,11 @@ int sqlite3VdbeCursorMoveto(Cursor *p){
if( p->deferredMoveto ){
int res;
extern int sqlite3_search_count;
- sqlite3BtreeMoveto(p->pCursor, (char*)&p->movetoTarget, sizeof(int), &res);
+ if( p->intKey ){
+ sqlite3BtreeMoveto(p->pCursor, 0, p->movetoTarget, &res);
+ }else{
+ sqlite3BtreeMoveto(p->pCursor,(char*)&p->movetoTarget,sizeof(i64),&res);
+ }
p->lastRecno = keyToInt(p->movetoTarget);
p->recnoIsValid = res==0;
if( res<0 ){