]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a bug in the parsing of wildcards that begin with '$'. (CVS 1901)
authordrh <drh@noemail.net>
Tue, 24 Aug 2004 15:23:34 +0000 (15:23 +0000)
committerdrh <drh@noemail.net>
Tue, 24 Aug 2004 15:23:34 +0000 (15:23 +0000)
FossilOrigin-Name: 054dd8901dbfe64a8f61e7b99e23512057bad99a

manifest
manifest.uuid
src/tclsqlite.c
src/tokenize.c

index 107a696462ec99b7d724b7b27383baf8b6ac3471..32769dd224362cb3dd8f6210909eed34771604f0 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\spager\sbug\sthat\smight\shave\smade\smulti-database\scommits\snon-atomic\nif\sa\spower\sfailure\soccurred\sat\sjust\sthe\swrong\smoment.\s(CVS\s1900)
-D 2004-08-21T19:20:42
+C Fix\sa\sbug\sin\sthe\sparsing\sof\swildcards\sthat\sbegin\swith\s'$'.\s(CVS\s1901)
+D 2004-08-24T15:23:34
 F Makefile.in 4a5e570a9e2d35b09c31b3cf01b78cea764ade4b
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -62,13 +62,13 @@ F src/shell.c 42f65424a948f197f389e13bc7aaa3cf24dafd0c
 F src/sqlite.h.in de2be4043f0bfa16958d33392a3e7a5e7d4bd50b
 F src/sqliteInt.h c7ed161ecc40f9fd0f080fbcc00e34bd7d6735ee
 F src/table.c 4521c278892f60e4d630788c0ea5cf4db1e75c49
-F src/tclsqlite.c 2e044cb0638c03fa38575fe607bdd4ee4885e1f4
+F src/tclsqlite.c 90de7fd34c4eb66e5c3223849b0042b4b55ce624
 F src/test1.c b87fae63b2994c150a579c4101f302be48ad77bc
 F src/test2.c f4c2f3928f1998fd8cb75a81e33a60e025ea85d4
 F src/test3.c 94d0a2a90bccd85802488cb42c69ec8afd2e4646
 F src/test4.c c38766914e924091516030b6a8b677d849c08bf0
 F src/test5.c b001fa7f1b9e2dc5c2331de62fc641b5ab2bd7a1
-F src/tokenize.c b96043fdf662d93ccfc758d3e1cdf2513f23eca2
+F src/tokenize.c d8ea315961f30d5a62232a98ec81d7ec1a72b087
 F src/trigger.c 8b147c6b8ae0bab3a13463a4ca9ab6ad61f1361d
 F src/update.c 151f1869ce532ed883f1ce26306f0b0fa7b2589a
 F src/utf.c 3d8f7bffcbefcced69a436c9e0a1c7eb9e0bb4fa
@@ -243,7 +243,7 @@ F www/tclsqlite.tcl 06a86cba4d7fc88e2bcd633b57702d3d16abebb5
 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P bd6649c5aae1bf182610eb267b546c297a34481d
-R f44107658e3b90d9c7e881af0ccb6474
+P b6eb4bf8c7763ef73723fc3d3697af435c19bae4
+R 8c0203ae9b9fb401a60a066d64e9f953
 U drh
-Z 5a36877b594a25790956a9835b384791
+Z d6e1c40c23af021b5f4969f3b7403dcc
index 3fdfb54b9b5be58b59cd23d5cfed94546dafc93d..8b02ff86013bd80741af4bfc0a983f28494f4a6c 100644 (file)
@@ -1 +1 @@
-b6eb4bf8c7763ef73723fc3d3697af435c19bae4
\ No newline at end of file
+054dd8901dbfe64a8f61e7b99e23512057bad99a
\ No newline at end of file
index 9fc5d6cef41f8cfedda517597cdb36819bb9b603..8d52ac3194b598a4060bf8fb6b7833e4a82c33a5 100644 (file)
@@ -11,7 +11,7 @@
 *************************************************************************
 ** A TCL Interface to SQLite
 **
-** $Id: tclsqlite.c,v 1.100 2004/08/20 18:34:20 drh Exp $
+** $Id: tclsqlite.c,v 1.101 2004/08/24 15:23:34 drh Exp $
 */
 #ifndef NO_TCL     /* Omit this whole file if TCL is unavailable */
 
@@ -693,9 +693,9 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
   ** that have the same name as the fields extracted by the query.
   */
   case DB_EVAL: {
-    char const *zSql;
-    char const *zLeft;
-    sqlite3_stmt *pStmt;
+    char const *zSql;      /* Next SQL statement to execute */
+    char const *zLeft;     /* What is left after first stmt in zSql */
+    sqlite3_stmt *pStmt;   /* Compiled SQL statment */
     Tcl_Obj *pArray;       /* Name of array into which results are written */
     Tcl_Obj *pScript;      /* Script to run for each result set */
 
index b15b0b1b3e906d741f38aeee933164fc15331ad2..ff9c32bee1fab3cd0703f37bb292d101ad94af46 100644 (file)
@@ -15,7 +15,7 @@
 ** individual tokens and sends those tokens one-by-one over to the
 ** parser for analysis.
 **
-** $Id: tokenize.c,v 1.82 2004/08/20 16:02:39 drh Exp $
+** $Id: tokenize.c,v 1.83 2004/08/24 15:23:34 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -385,6 +385,7 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){
     }
     case '$': {
       int c;
+      *tokenType = TK_VARIABLE;
       if( z[1]=='{' ){
         int nBrace = 1;
         for(i=2; (c=z[i])!=0 && nBrace; i++){
@@ -394,7 +395,7 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){
             nBrace--;
           }
         }
-        *tokenType = c!=0 ? TK_VARIABLE : TK_ILLEGAL;
+        if( c==0 ) *tokenType = TK_ILLEGAL;
       }else{
         int n = 0;
         for(i=1; (c=z[i])!=0; i++){
@@ -406,7 +407,6 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){
             }while( (c=z[i])!=0 && !isspace(c) && c!=')' );
             if( c==')' ){
               i++;
-              *tokenType = TK_VARIABLE;
             }else{
               *tokenType = TK_ILLEGAL;
             }
@@ -414,10 +414,10 @@ static int sqliteGetToken(const unsigned char *z, int *tokenType){
           }else if( c==':' && z[i+1]==':' ){
             i++;
           }else{
-            *tokenType = n==0 ? TK_ILLEGAL : TK_VARIABLE;
             break;
           }
         }
+        if( n==0 ) *tokenType = TK_ILLEGAL;
       }
       return i;
     }