1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Bug fixes. (CVS 306)

FossilOrigin-Name: 84997fda33fd6ce93b821d3da3a7251cf60e06ec
This commit is contained in:
drh
2001-11-09 13:41:09 +00:00
parent 487ab3ca18
commit ce927065c2
5 changed files with 33 additions and 27 deletions

View File

@ -1,5 +1,5 @@
C The\snew\scode\sfor\staking\sadvantage\sof\sinequalities\sin\sWHERE\sclauses\nis\sin\splace.\s\sIt\sappears\sto\swork.\s(CVS\s305) C Bug\sfixes.\s(CVS\s306)
D 2001-11-08T00:45:21 D 2001-11-09T13:41:10
F Makefile.in 6801df952cb1df64aa32e4de85fed24511d28efd F Makefile.in 6801df952cb1df64aa32e4de85fed24511d28efd
F Makefile.template 1fdb891f14083ee0b63cf7282f91529634438e7a F Makefile.template 1fdb891f14083ee0b63cf7282f91529634438e7a
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@ -42,16 +42,16 @@ F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in 934de9112747ad8d8e7d5fec44876246b24ca5a3 F src/sqlite.h.in 934de9112747ad8d8e7d5fec44876246b24ca5a3
F src/sqliteInt.h aa26c7f8a0c5c3210a81177c60ca08bf8f3f7825 F src/sqliteInt.h aa26c7f8a0c5c3210a81177c60ca08bf8f3f7825
F src/table.c c89698bd5bb4b8d14722d6ee7e9be014c383d24a F src/table.c c89698bd5bb4b8d14722d6ee7e9be014c383d24a
F src/tclsqlite.c 4896e078495bf868742f5394dcf01c5efe5bea02 F src/tclsqlite.c b82e4faeae89fdb7304b3c970979ade299336a1f
F src/test1.c 41eabe255970ef947263b94145c9b2766bab8675 F src/test1.c 41eabe255970ef947263b94145c9b2766bab8675
F src/test2.c e9f99aa5ee73872819259d6612c11e55e1644321 F src/test2.c e9f99aa5ee73872819259d6612c11e55e1644321
F src/test3.c 4a0d7b882fdae731dbb759f512ad867122452f96 F src/test3.c d6775f95fd91f5b3cf0e2382a28e5aaeb68f745b
F src/tokenize.c 830e9ef684334070a26583d94770bb869e2727bf F src/tokenize.c 830e9ef684334070a26583d94770bb869e2727bf
F src/update.c b1e315e20b98a013d30fd9ff3b7d9dc4f29b39b3 F src/update.c b1e315e20b98a013d30fd9ff3b7d9dc4f29b39b3
F src/util.c ac83973ecc647d3d3c58708f148442365abf9b94 F src/util.c ac83973ecc647d3d3c58708f148442365abf9b94
F src/vdbe.c b4cdc0017bf0574ededf17d7ff5f1d66a58bf430 F src/vdbe.c b4cdc0017bf0574ededf17d7ff5f1d66a58bf430
F src/vdbe.h cd4c8647051a0c22c0e133c375f1cd17bb8b1e06 F src/vdbe.h cd4c8647051a0c22c0e133c375f1cd17bb8b1e06
F src/where.c 13a112b720fffd40612051f9e6d37262c4c818c8 F src/where.c d51e6380dcd0ddb6767add378f266ffb1555403a
F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe
F test/bigrow.test 9458134d67f81559845f934fdd6802fe19a68ad1 F test/bigrow.test 9458134d67f81559845f934fdd6802fe19a68ad1
F test/btree.test 47952c7a0c22660566264c68c0664592b7da85ce F test/btree.test 47952c7a0c22660566264c68c0664592b7da85ce
@ -115,7 +115,7 @@ F www/speed.tcl 212a91d555384e01873160d6a189f1490c791bc2
F www/sqlite.tcl 6a21242a272e9c0939a04419a51c3d50cae33e3e F www/sqlite.tcl 6a21242a272e9c0939a04419a51c3d50cae33e3e
F www/tclsqlite.tcl 13d50723f583888fc80ae1a38247c0ab415066fa F www/tclsqlite.tcl 13d50723f583888fc80ae1a38247c0ab415066fa
F www/vdbe.tcl bb7d620995f0a987293e9d4fb6185a3b077e9b44 F www/vdbe.tcl bb7d620995f0a987293e9d4fb6185a3b077e9b44
P decbeb9151885fee473b3fa58c8cf78a2338d2d8 P 262bcd17df19f45def6144b5a7e0602ca5b03deb
R d92c3b8d059b1ac938a54da5297c6da3 R f54b51f56bb87d8fefdd0ec8ce58b976
U drh U drh
Z 73b06b3dcf3434a2ed8ea2fd74f12aeb Z 41ecae8afdab61183662635580d28dbf

View File

@ -1 +1 @@
262bcd17df19f45def6144b5a7e0602ca5b03deb 84997fda33fd6ce93b821d3da3a7251cf60e06ec

View File

@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** A TCL Interface to SQLite ** A TCL Interface to SQLite
** **
** $Id: tclsqlite.c,v 1.27 2001/10/22 02:58:10 drh Exp $ ** $Id: tclsqlite.c,v 1.28 2001/11/09 13:41:10 drh Exp $
*/ */
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@ -19,6 +19,7 @@
#include "tcl.h" #include "tcl.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <assert.h>
/* /*
** If TCL uses UTF-8 and SQLite is configured to use iso8859, then we ** If TCL uses UTF-8 and SQLite is configured to use iso8859, then we
@ -50,7 +51,7 @@ struct CallbackData {
Tcl_Interp *interp; /* The TCL interpreter */ Tcl_Interp *interp; /* The TCL interpreter */
char *zArray; /* The array into which data is written */ char *zArray; /* The array into which data is written */
Tcl_Obj *pCode; /* The code to execute for each row */ Tcl_Obj *pCode; /* The code to execute for each row */
int once; /* Set only for the first invocation of callback */ int once; /* Set for first callback only */
int tcl_rc; /* Return code from TCL script */ int tcl_rc; /* Return code from TCL script */
int nColName; /* Number of entries in the azColName[] array */ int nColName; /* Number of entries in the azColName[] array */
char **azColName; /* Column names translated to UTF-8 */ char **azColName; /* Column names translated to UTF-8 */
@ -74,26 +75,29 @@ static int DbEvalCallback(
int i, rc; int i, rc;
Tcl_DString dCol; Tcl_DString dCol;
Tcl_DStringInit(&dCol); Tcl_DStringInit(&dCol);
if( azCol==0 || (cbData->once && cbData->zArray[0]) ){ if( cbData->azColName==0 ){
Tcl_SetVar2(cbData->interp, cbData->zArray, "*", "", 0); assert( cbData->once );
if( azCol ){ cbData->once = 0;
cbData->azColName = malloc( nCol*sizeof(char*) ); if( cbData->zArray[0] ){
if( cbData->azColName==0 ){ return 1; } Tcl_SetVar2(cbData->interp, cbData->zArray, "*", "", 0);
} }
cbData->azColName = malloc( nCol*sizeof(char*) );
if( cbData->azColName==0 ){ return 1; }
cbData->nColName = nCol; cbData->nColName = nCol;
for(i=0; i<nCol; i++){ for(i=0; i<nCol; i++){
Tcl_ExternalToUtfDString(NULL, azN[i], -1, &dCol); Tcl_ExternalToUtfDString(NULL, azN[i], -1, &dCol);
if( azCol ){ cbData->azColName[i] = malloc( Tcl_DStringLength(&dCol) + 1 );
cbData->azColName[i] = malloc( Tcl_DStringLength(&dCol) + 1); if( cbData->azColName[i] ){
if( cbData->azColName[i] ){ strcpy(cbData->azColName[i], Tcl_DStringValue(&dCol));
strcpy(cbData->azColName[i], Tcl_DStringValue(&dCol)); }else{
} return 1;
}
if( cbData->zArray[0] ){
Tcl_SetVar2(cbData->interp, cbData->zArray, "*",
Tcl_DStringValue(&dCol), TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
} }
Tcl_SetVar2(cbData->interp, cbData->zArray, "*", Tcl_DStringValue(&dCol),
TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
Tcl_DStringFree(&dCol); Tcl_DStringFree(&dCol);
} }
cbData->once = 0;
} }
if( azCol!=0 ){ if( azCol!=0 ){
if( cbData->zArray[0] ){ if( cbData->zArray[0] ){
@ -414,6 +418,7 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
if( cbData.azColName[i] ) free(cbData.azColName[i]); if( cbData.azColName[i] ) free(cbData.azColName[i]);
} }
free(cbData.azColName); free(cbData.azColName);
cbData.azColName = 0;
} }
#endif #endif
return rc; return rc;

View File

@ -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.12 2001/09/23 02:35:53 drh Exp $ ** $Id: test3.c,v 1.13 2001/11/09 13:41:10 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "pager.h" #include "pager.h"
@ -589,6 +589,8 @@ static int btree_move_to(
Tcl_AppendResult(interp, errorName(rc), 0); Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR; return TCL_ERROR;
} }
if( res<0 ) res = -1;
if( res>0 ) res = 1;
sprintf(zBuf,"%d",res); sprintf(zBuf,"%d",res);
Tcl_AppendResult(interp, zBuf, 0); Tcl_AppendResult(interp, zBuf, 0);
return SQLITE_OK; return SQLITE_OK;

View File

@ -13,7 +13,7 @@
** the WHERE clause of SQL statements. Also found here are subroutines ** the WHERE clause of SQL statements. Also found here are subroutines
** to generate VDBE code to evaluate expressions. ** to generate VDBE code to evaluate expressions.
** **
** $Id: where.c,v 1.26 2001/11/08 00:45:22 drh Exp $ ** $Id: where.c,v 1.27 2001/11/09 13:41:10 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@ -409,7 +409,6 @@ WhereInfo *sqliteWhereBegin(
if( goDirect ){ if( goDirect ){
/* Case 1: We can directly reference a single row using the ROWID field. /* Case 1: We can directly reference a single row using the ROWID field.
*/ */
cont = brk;
for(k=0; k<nExpr; k++){ for(k=0; k<nExpr; k++){
if( aExpr[k].p==0 ) continue; if( aExpr[k].p==0 ) continue;
if( aExpr[k].idxLeft==idx if( aExpr[k].idxLeft==idx