1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix to the SUBSTR() function and to the bigrow test. (CVS 310)

FossilOrigin-Name: 8437076c25330759ae058918a8190df26d0881da
This commit is contained in:
drh
2001-11-12 13:10:52 +00:00
parent 778326010c
commit 84e6b7b5ae
4 changed files with 21 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
C Version\s2.1.0\sprerelease\s(CVS\s309) C Fix\sto\sthe\sSUBSTR()\sfunction\sand\sto\sthe\sbigrow\stest.\s(CVS\s310)
D 2001-11-12T12:43:22 D 2001-11-12T13:10:53
F Makefile.in 6801df952cb1df64aa32e4de85fed24511d28efd F Makefile.in 6801df952cb1df64aa32e4de85fed24511d28efd
F Makefile.template 1fdb891f14083ee0b63cf7282f91529634438e7a F Makefile.template 1fdb891f14083ee0b63cf7282f91529634438e7a
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@@ -49,11 +49,11 @@ 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 807d648da2113eb65b2d5c59c18e51cd8896a972 F src/vdbe.c 43005a896d2e61368001620c66c4fe3769cd03c9
F src/vdbe.h cd4c8647051a0c22c0e133c375f1cd17bb8b1e06 F src/vdbe.h cd4c8647051a0c22c0e133c375f1cd17bb8b1e06
F src/where.c d51e6380dcd0ddb6767add378f266ffb1555403a F src/where.c d51e6380dcd0ddb6767add378f266ffb1555403a
F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe
F test/bigrow.test 9458134d67f81559845f934fdd6802fe19a68ad1 F test/bigrow.test 1f098f85586d2117bdb3412d27eba45252bc8a6e
F test/btree.test 47952c7a0c22660566264c68c0664592b7da85ce F test/btree.test 47952c7a0c22660566264c68c0664592b7da85ce
F test/btree2.test 08e9485619265cbaf5d11bd71f357cdc26bb87e0 F test/btree2.test 08e9485619265cbaf5d11bd71f357cdc26bb87e0
F test/copy.test 768e6f1701a07d08090e1ca7f7dcce0a7a72b43e F test/copy.test 768e6f1701a07d08090e1ca7f7dcce0a7a72b43e
@@ -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 2d2ad264aad6fbdcef586e73d750e3fde842252f P 4f4ac42214610d900a5d6db63a511d9e7b22f0f9
R 16c00ab1c6dd8026c015350394df2b49 R e411b3c66de534a8413fb698adfa9839
U drh U drh
Z a0e64c7188bd5b5811337fabdc6b35c2 Z 3eccdf57f8fc40705e6bc160315f6362

View File

@@ -1 +1 @@
4f4ac42214610d900a5d6db63a511d9e7b22f0f9 8437076c25330759ae058918a8190df26d0881da

View File

@@ -30,7 +30,7 @@
** But other routines are also provided to help in building up ** But other routines are also provided to help in building up
** a program instruction by instruction. ** a program instruction by instruction.
** **
** $Id: vdbe.c,v 1.97 2001/11/10 13:51:09 drh Exp $ ** $Id: vdbe.c,v 1.98 2001/11/12 13:10:53 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -3986,11 +3986,12 @@ case OP_Substr: {
if( pOp->p1==0 ){ if( pOp->p1==0 ){
VERIFY( if( p->tos<0 ) goto not_enough_stack; ) VERIFY( if( p->tos<0 ) goto not_enough_stack; )
Integerify(p, p->tos); Integerify(p, p->tos);
start = aStack[p->tos].i - 1; start = aStack[p->tos].i;
POPSTACK; POPSTACK;
}else{ }else{
start = pOp->p1 - 1; start = pOp->p1;
} }
if( start>0 ) start--;
VERIFY( if( p->tos<0 ) goto not_enough_stack; ) VERIFY( if( p->tos<0 ) goto not_enough_stack; )
if( Stringify(p, p->tos) ) goto no_mem; if( Stringify(p, p->tos) ) goto no_mem;
@@ -4093,7 +4094,13 @@ default: {
int j, k; int j, k;
char zBuf[100]; char zBuf[100];
zBuf[0] = ' '; zBuf[0] = ' ';
zBuf[1] = (aStack[i].flags & STK_Dyn)!=0 ? 'z' : 's'; if( aStack[i].flags & STK_Dyn ){
zBuf[1] = 'z';
}else if( aStack[i].flags & STK_Static ){
zBuf[1] = 't';
}else{
zBuf[1] = 's';
}
zBuf[2] = '['; zBuf[2] = '[';
k = 3; k = 3;
for(j=0; j<20 && j<aStack[i].n; j++){ for(j=0; j<20 && j<aStack[i].n; j++){

View File

@@ -12,7 +12,7 @@
# focus of this file is stressing the library by putting large amounts # focus of this file is stressing the library by putting large amounts
# of data in a single row of a table. # of data in a single row of a table.
# #
# $Id: bigrow.test,v 1.2 2001/11/04 18:32:48 drh Exp $ # $Id: bigrow.test,v 1.3 2001/11/12 13:10:53 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@@ -173,7 +173,7 @@ do_test bigrow-4.2 {
} {one 122880 hi} } {one 122880 hi}
do_test bigrow-4.3 { do_test bigrow-4.3 {
execsql { execsql {
UPDATE t1 SET b=substr(b,0,65515) UPDATE t1 SET b=substr(b,1,65515)
} }
execsql {SELECT a,length(b),c FROM t1} execsql {SELECT a,length(b),c FROM t1}
} {one 65515 hi} } {one 65515 hi}