mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Minor changes to the vdbe so that more tests pass. (CVS 1352)
FossilOrigin-Name: 16078fe0ea146537f75b869e6b0cce202af6781b
This commit is contained in:
9
main.mk
9
main.mk
@@ -110,6 +110,15 @@ SRC = \
|
|||||||
# Source code to the test files.
|
# Source code to the test files.
|
||||||
#
|
#
|
||||||
TESTSRC = \
|
TESTSRC = \
|
||||||
|
$(TOP)/src/os.c \
|
||||||
|
$(TOP)/src/pager.c \
|
||||||
|
$(TOP)/src/test1.c \
|
||||||
|
$(TOP)/src/test2.c \
|
||||||
|
$(TOP)/src/test3.c \
|
||||||
|
$(TOP)/src/test5.c \
|
||||||
|
$(TOP)/src/md5.c
|
||||||
|
|
||||||
|
TESTSRC_ORIG = \
|
||||||
$(TOP)/src/btree.c \
|
$(TOP)/src/btree.c \
|
||||||
$(TOP)/src/func.c \
|
$(TOP)/src/func.c \
|
||||||
$(TOP)/src/os.c \
|
$(TOP)/src/os.c \
|
||||||
|
22
manifest
22
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sup\sa\scouple\sof\slittle\sthings\sin\sthe\svdbe.\sselect1.test\spasses\snow.\s(CVS\s1351)
|
C Minor\schanges\sto\sthe\svdbe\sso\sthat\smore\stests\spass.\s(CVS\s1352)
|
||||||
D 2004-05-11T04:54:49
|
D 2004-05-11T06:17:22
|
||||||
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
|
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
|
||||||
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
|
||||||
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
|
||||||
@@ -15,7 +15,7 @@ F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
|
|||||||
F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
|
F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
|
||||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
|
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
|
||||||
F ltmain.sh f6b283068efa69f06eb8aa1fe4bddfdbdeb35826
|
F ltmain.sh f6b283068efa69f06eb8aa1fe4bddfdbdeb35826
|
||||||
F main.mk 167a4c8759531ce5d4eece431c3b962534eee157
|
F main.mk 08bc0f1706964e029ef0319af0271ad79427cc71
|
||||||
F publish.sh 1cd5c982388560fa91eedf6a338e210f713b35c8
|
F publish.sh 1cd5c982388560fa91eedf6a338e210f713b35c8
|
||||||
F spec.template a38492f1c1dd349fc24cb0565e08afc53045304b
|
F spec.template a38492f1c1dd349fc24cb0565e08afc53045304b
|
||||||
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
|
F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
|
||||||
@@ -51,8 +51,8 @@ F src/shell.c 255b8b9023cb5274f56d87df437e8ce6ef810b91
|
|||||||
F src/sqlite.h.in 799c5e726296ec7bc20e6407cdf4df0e0bc00c0c
|
F src/sqlite.h.in 799c5e726296ec7bc20e6407cdf4df0e0bc00c0c
|
||||||
F src/sqliteInt.h 16365a1a4cb28a9edcaada45d40d104112b3544c
|
F src/sqliteInt.h 16365a1a4cb28a9edcaada45d40d104112b3544c
|
||||||
F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2
|
F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2
|
||||||
F src/tclsqlite.c a38bf2263a097fcc9603e818c291151de1782c11
|
F src/tclsqlite.c fbf0fac73624ae246551a6c671f1de0235b5faa1
|
||||||
F src/test1.c 79956f70dddd1a28f8577bbd61c8cf28e5875eb8
|
F src/test1.c ba4c25985916a82cfa375145a90e2c8d4b0a6a20
|
||||||
F src/test2.c 6195a1ca2c8d0d2d93644e86da3289b403486872
|
F src/test2.c 6195a1ca2c8d0d2d93644e86da3289b403486872
|
||||||
F src/test3.c 1b3ac2199169fb331685c7bef15ad54721db278b
|
F src/test3.c 1b3ac2199169fb331685c7bef15ad54721db278b
|
||||||
F src/test4.c b3fab9aea7a8940a8a7386ce1c7e2157b09bd296
|
F src/test4.c b3fab9aea7a8940a8a7386ce1c7e2157b09bd296
|
||||||
@@ -61,12 +61,12 @@ F src/tokenize.c e7536dd31205d5afb76c1bdc832dea009c7a3847
|
|||||||
F src/trigger.c 8df308e09113410bb895e88a2db65b55490268db
|
F src/trigger.c 8df308e09113410bb895e88a2db65b55490268db
|
||||||
F src/update.c 6ca82fc4a0fb4d7f134e961921c906f6f3c8bc74
|
F src/update.c 6ca82fc4a0fb4d7f134e961921c906f6f3c8bc74
|
||||||
F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f
|
F src/utf.c fc799748d43fe1982d157b871e3e420a19c85d4f
|
||||||
F src/util.c 74ee316594f68c41aed1884d737ab4085d479455
|
F src/util.c 778a8cd03ad6e52778602d20a3132c7d2d1b0a0c
|
||||||
F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
F src/vacuum.c c134702e023db8778e6be59ac0ea7b02315b5476
|
||||||
F src/vdbe.c 7ac68210a0cba08918ec62fb2aa6c9c8b5354a7d
|
F src/vdbe.c 06986aa8bbc244c51db532009649653161308721
|
||||||
F src/vdbe.h 2dc4d1161b64f5684faa6a2d292e318a185ecb2e
|
F src/vdbe.h 2dc4d1161b64f5684faa6a2d292e318a185ecb2e
|
||||||
F src/vdbeInt.h ff85e432a43eb7533b17c9cece2baaf813ba8711
|
F src/vdbeInt.h ff85e432a43eb7533b17c9cece2baaf813ba8711
|
||||||
F src/vdbeaux.c 7162f1390620257e25070da1ac2b4ec83e472752
|
F src/vdbeaux.c feee0e94cd5fe520cd024287446d8b387a221a4b
|
||||||
F src/where.c 487e55b1f64c8fbf0f46a9a90c2247fc45ae6a9a
|
F src/where.c 487e55b1f64c8fbf0f46a9a90c2247fc45ae6a9a
|
||||||
F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242
|
F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242
|
||||||
F test/attach.test 76f096f384221f775cc0a856e51d5a35f9ee1541
|
F test/attach.test 76f096f384221f775cc0a856e51d5a35f9ee1541
|
||||||
@@ -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 2fffd133a5e0058f02c20c498875093261e9ee19
|
P 9ba0df4d7792dccb67782113751c0e5807348d62
|
||||||
R d171f27f9b6b82ac42b288cfd79095c1
|
R 27fbbe84d40cb05d543d6a157e6083bd
|
||||||
U danielk1977
|
U danielk1977
|
||||||
Z db84b4c7f4e2ad4c5507de4c7ea2b708
|
Z 22184866a2212de63e75bbfdcd50c70f
|
||||||
|
@@ -1 +1 @@
|
|||||||
9ba0df4d7792dccb67782113751c0e5807348d62
|
16078fe0ea146537f75b869e6b0cce202af6781b
|
@@ -11,7 +11,7 @@
|
|||||||
*************************************************************************
|
*************************************************************************
|
||||||
** A TCL Interface to SQLite
|
** 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 */
|
#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 Sqlitetest4_Init(Tcl_Interp*);
|
||||||
extern int Sqlitetest5_Init(Tcl_Interp*);
|
extern int Sqlitetest5_Init(Tcl_Interp*);
|
||||||
extern int Md5_Init(Tcl_Interp*);
|
extern int Md5_Init(Tcl_Interp*);
|
||||||
/* Sqlitetest1_Init(interp); */
|
Sqlitetest1_Init(interp);
|
||||||
Sqlitetest2_Init(interp);
|
Sqlitetest2_Init(interp);
|
||||||
Sqlitetest3_Init(interp);
|
Sqlitetest3_Init(interp);
|
||||||
/* Sqlitetest4_Init(interp); */
|
/* Sqlitetest4_Init(interp); */
|
||||||
|
10
src/test1.c
10
src/test1.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: 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 "sqliteInt.h"
|
||||||
#include "tcl.h"
|
#include "tcl.h"
|
||||||
@@ -1010,13 +1010,13 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
|||||||
for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
|
for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
|
||||||
Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
|
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);
|
(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);
|
(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);
|
(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);
|
(char*)&sqlite3_current_time, TCL_LINK_INT);
|
||||||
Tcl_LinkVar(interp, "sqlite_static_bind_value",
|
Tcl_LinkVar(interp, "sqlite_static_bind_value",
|
||||||
(char*)&sqlite_static_bind_value, TCL_LINK_STRING);
|
(char*)&sqlite_static_bind_value, TCL_LINK_STRING);
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
** This file contains functions for allocating memory, comparing
|
** This file contains functions for allocating memory, comparing
|
||||||
** strings, and stuff like that.
|
** 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 "sqliteInt.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@@ -1148,7 +1148,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
|||||||
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);
|
||||||
}
|
}
|
||||||
*v = x;
|
*v = x;
|
||||||
return n;
|
return n;
|
||||||
|
29
src/vdbe.c
29
src/vdbe.c
@@ -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.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 "sqliteInt.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@@ -2245,8 +2245,8 @@ case OP_MakeRecord: {
|
|||||||
**
|
**
|
||||||
** Convert the top P1 entries of the stack into a single entry suitable
|
** 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
|
** 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
|
** off of the stack, treat that integer as an eight-byte record number, and
|
||||||
** append the four bytes to the key. Thus a total of P1+1 entries are
|
** 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
|
** 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
|
** back. The first P1 entries that are popped are strings and the last
|
||||||
** entry (the lowest on the stack) is an integer record number.
|
** entry (the lowest on the stack) is an integer record number.
|
||||||
@@ -2319,7 +2319,7 @@ case OP_MakeKey: {
|
|||||||
rc = SQLITE_TOOBIG;
|
rc = SQLITE_TOOBIG;
|
||||||
goto abort_due_to_error;
|
goto abort_due_to_error;
|
||||||
}
|
}
|
||||||
if( addRowid ) nByte += sizeof(u32);
|
if( addRowid ) nByte += sizeof(i64);
|
||||||
if( nByte<=NBFS ){
|
if( nByte<=NBFS ){
|
||||||
zNewKey = zTemp;
|
zNewKey = zTemp;
|
||||||
}else{
|
}else{
|
||||||
@@ -2344,12 +2344,13 @@ case OP_MakeKey: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( addRowid ){
|
if( addRowid ){
|
||||||
u32 iKey;
|
i64 iKey;
|
||||||
pRec = &pTos[-nField];
|
pRec = &pTos[-nField];
|
||||||
assert( pRec>=p->aStack );
|
assert( pRec>=p->aStack );
|
||||||
Integerify(pRec);
|
Integerify(pRec);
|
||||||
|
/* TODO */
|
||||||
iKey = intToKey(pRec->i);
|
iKey = intToKey(pRec->i);
|
||||||
memcpy(&zNewKey[j], &iKey, sizeof(u32));
|
memcpy(&zNewKey[j], &iKey, sizeof(i64));
|
||||||
popStack(&pTos, nField+1);
|
popStack(&pTos, nField+1);
|
||||||
if( pOp->p2 && containsNull ) pc = pOp->p2 - 1;
|
if( pOp->p2 && containsNull ) pc = pOp->p2 - 1;
|
||||||
}else{
|
}else{
|
||||||
@@ -3355,7 +3356,10 @@ case OP_RowData: {
|
|||||||
pTos->flags = MEM_Null;
|
pTos->flags = MEM_Null;
|
||||||
break;
|
break;
|
||||||
}else if( pC->keyAsData || pOp->opcode==OP_RowKey ){
|
}else if( pC->keyAsData || pOp->opcode==OP_RowKey ){
|
||||||
/* TODO: sqlite3BtreeKeySize(pCrsr, &n); */
|
i64 n64;
|
||||||
|
assert( !pC->intKey );
|
||||||
|
sqlite3BtreeKeySize(pCrsr, &n64);
|
||||||
|
n = n64;
|
||||||
}else{
|
}else{
|
||||||
sqlite3BtreeDataSize(pCrsr, &n);
|
sqlite3BtreeDataSize(pCrsr, &n);
|
||||||
}
|
}
|
||||||
@@ -3804,14 +3808,15 @@ case OP_IdxRecno: {
|
|||||||
assert( i>=0 && i<p->nCursor );
|
assert( i>=0 && i<p->nCursor );
|
||||||
pTos++;
|
pTos++;
|
||||||
if( (pCrsr = p->aCsr[i].pCursor)!=0 ){
|
if( (pCrsr = p->aCsr[i].pCursor)!=0 ){
|
||||||
int v;
|
i64 v;
|
||||||
int sz;
|
u64 sz;
|
||||||
assert( p->aCsr[i].deferredMoveto==0 );
|
assert( p->aCsr[i].deferredMoveto==0 );
|
||||||
/* TODO: sqlite3BtreeKeySize(pCrsr, &sz); */
|
assert( p->aCsr[i].intKey==0 );
|
||||||
if( sz<sizeof(u32) ){
|
sqlite3BtreeKeySize(pCrsr, &sz);
|
||||||
|
if( sz<sizeof(i64) ){
|
||||||
pTos->flags = MEM_Null;
|
pTos->flags = MEM_Null;
|
||||||
}else{
|
}else{
|
||||||
sqlite3BtreeKey(pCrsr, sz - sizeof(u32), sizeof(u32), (char*)&v);
|
sqlite3BtreeKey(pCrsr, sz - sizeof(i64), sizeof(i64), (char*)&v);
|
||||||
v = keyToInt(v);
|
v = keyToInt(v);
|
||||||
pTos->i = v;
|
pTos->i = v;
|
||||||
pTos->flags = MEM_Int;
|
pTos->flags = MEM_Int;
|
||||||
|
@@ -1048,7 +1048,11 @@ int sqlite3VdbeCursorMoveto(Cursor *p){
|
|||||||
if( p->deferredMoveto ){
|
if( p->deferredMoveto ){
|
||||||
int res;
|
int res;
|
||||||
extern int sqlite3_search_count;
|
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->lastRecno = keyToInt(p->movetoTarget);
|
||||||
p->recnoIsValid = res==0;
|
p->recnoIsValid = res==0;
|
||||||
if( res<0 ){
|
if( res<0 ){
|
||||||
|
Reference in New Issue
Block a user