]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix to the SUBSTR() function and to the bigrow test. (CVS 310)
authordrh <drh@noemail.net>
Mon, 12 Nov 2001 13:10:52 +0000 (13:10 +0000)
committerdrh <drh@noemail.net>
Mon, 12 Nov 2001 13:10:52 +0000 (13:10 +0000)
FossilOrigin-Name: 8437076c25330759ae058918a8190df26d0881da

manifest
manifest.uuid
src/vdbe.c
test/bigrow.test

index 47d022d2446dfd71de8f3f0f860e4537e5ec9315..1fae16de10adb19ff495711e85299979891f5471 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Version\s2.1.0\sprerelease\s(CVS\s309)
-D 2001-11-12T12:43:22
+C Fix\sto\sthe\sSUBSTR()\sfunction\sand\sto\sthe\sbigrow\stest.\s(CVS\s310)
+D 2001-11-12T13:10:53
 F Makefile.in 6801df952cb1df64aa32e4de85fed24511d28efd
 F Makefile.template 1fdb891f14083ee0b63cf7282f91529634438e7a
 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@@ -49,11 +49,11 @@ F src/test3.c d6775f95fd91f5b3cf0e2382a28e5aaeb68f745b
 F src/tokenize.c 830e9ef684334070a26583d94770bb869e2727bf
 F src/update.c b1e315e20b98a013d30fd9ff3b7d9dc4f29b39b3
 F src/util.c ac83973ecc647d3d3c58708f148442365abf9b94
-F src/vdbe.c 807d648da2113eb65b2d5c59c18e51cd8896a972
+F src/vdbe.c 43005a896d2e61368001620c66c4fe3769cd03c9
 F src/vdbe.h cd4c8647051a0c22c0e133c375f1cd17bb8b1e06
 F src/where.c d51e6380dcd0ddb6767add378f266ffb1555403a
 F test/all.test 2a51e5395ac7c2c539689b123b9782a05e3837fe
-F test/bigrow.test 9458134d67f81559845f934fdd6802fe19a68ad1
+F test/bigrow.test 1f098f85586d2117bdb3412d27eba45252bc8a6e
 F test/btree.test 47952c7a0c22660566264c68c0664592b7da85ce
 F test/btree2.test 08e9485619265cbaf5d11bd71f357cdc26bb87e0
 F test/copy.test 768e6f1701a07d08090e1ca7f7dcce0a7a72b43e
@@ -115,7 +115,7 @@ F www/speed.tcl 212a91d555384e01873160d6a189f1490c791bc2
 F www/sqlite.tcl 6a21242a272e9c0939a04419a51c3d50cae33e3e
 F www/tclsqlite.tcl 13d50723f583888fc80ae1a38247c0ab415066fa
 F www/vdbe.tcl bb7d620995f0a987293e9d4fb6185a3b077e9b44
-P 2d2ad264aad6fbdcef586e73d750e3fde842252f
-R 16c00ab1c6dd8026c015350394df2b49
+P 4f4ac42214610d900a5d6db63a511d9e7b22f0f9
+R e411b3c66de534a8413fb698adfa9839
 U drh
-Z a0e64c7188bd5b5811337fabdc6b35c2
+Z 3eccdf57f8fc40705e6bc160315f6362
index 25e88777de4abdb073a9b7adc2f30127fa4e2f1e..5be9038b446679578a4488c2e34aa33cf36ef946 100644 (file)
@@ -1 +1 @@
-4f4ac42214610d900a5d6db63a511d9e7b22f0f9
\ No newline at end of file
+8437076c25330759ae058918a8190df26d0881da
\ No newline at end of file
index 3f9fae38c7ac938f1694e65acfae63bcf8bc8ddc..c6b231284e9e7a272df346b0b8566f8ee449ecfa 100644 (file)
@@ -30,7 +30,7 @@
 ** But other routines are also provided to help in building up
 ** 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 <ctype.h>
@@ -3986,11 +3986,12 @@ case OP_Substr: {
   if( pOp->p1==0 ){
     VERIFY( if( p->tos<0 ) goto not_enough_stack; )
     Integerify(p, p->tos);
-    start = aStack[p->tos].i - 1;
+    start = aStack[p->tos].i;
     POPSTACK;
   }else{
-    start = pOp->p1 - 1;
+    start = pOp->p1;
   }
+  if( start>0 ) start--;
   VERIFY( if( p->tos<0 ) goto not_enough_stack; )
   if( Stringify(p, p->tos) ) goto no_mem;
 
@@ -4093,7 +4094,13 @@ default: {
           int j, k;
           char zBuf[100];
           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] = '[';
           k = 3;
           for(j=0; j<20 && j<aStack[i].n; j++){
index 8851c2d0bb84c5ce7c6a580d1840b934a29c8559..ce1150c44b3f582532f6a889c74a985953ab8b36 100644 (file)
@@ -12,7 +12,7 @@
 # focus of this file is stressing the library by putting large amounts
 # 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]
 source $testdir/tester.tcl
@@ -173,7 +173,7 @@ do_test bigrow-4.2 {
 } {one 122880 hi}
 do_test bigrow-4.3 {
   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}
 } {one 65515 hi}