]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
:-) (CVS 18)
authordrh <drh@noemail.net>
Tue, 30 May 2000 19:22:26 +0000 (19:22 +0000)
committerdrh <drh@noemail.net>
Tue, 30 May 2000 19:22:26 +0000 (19:22 +0000)
FossilOrigin-Name: 2d41caec807a6ab83b67e59c849ebbda004f2869

manifest
manifest.uuid
src/build.c

index 9de2f91bc64650a6f58965522993b33782dd799b..dd29e43578854cd2da6a61628d0f58f3cd1473dc 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,12 +1,12 @@
-C loads\sthe\scomplete\sACD\sdatabase!\s(CVS\s17)
-D 2000-05-30T18:45:24
+C :-)\s(CVS\s18)
+D 2000-05-30T19:22:26
 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
 F Makefile.in 89921c1ee4de75275bfadfbac198396da31704d1
 F README 6b5960603c7f8bf42fc022b4b6436f242f238dbb
 F configure 00a5b5c82147a576fa6e82d7c1b0d55c321d6d2c x
 F configure.in 6ccfd5fc80517f7cfe605a7fc7e0f62d962a233c
 F doc/lemon.html e233a3e97a779c7a87e1bc4528c664a58e49dd47
-F src/build.c 82e7dfdf900428d706ab4f50e72732ce9110767a
+F src/build.c 335df4b65f49d335438d3a0cd7e48d19713a1917
 F src/dbbe.c 159c39f8bf5475c34904786fad4f3f0f579d9eb6
 F src/dbbe.h bedeb3a0985bb584458e7849fb59927e99e751e6
 F src/main.c 25cce7bce0eb3ba10bada7c05f4b38dc6dbbc86f
@@ -38,7 +38,7 @@ F tool/renumberOps.awk 6d067177ad5f8d711b79577b462da9b3634bd0a9
 F www/c_interface.tcl f875864edf7974157d1c257ca08de854660882a5
 F www/index.tcl 2466d1b2e26c6f354b0acedee12025309a216799
 F www/sqlite.tcl 947e067bcc347dc767af4c1a6e5a8d47d8404aa3
-P b56d1b9c0f957f3dfb380c01d31ff7c08bcd523b
-R 78e3e4cb06d949e0d5e02f0a9620a6a4
+P 97a0fb780ea1992c4d681cc0301bbfa1a06c2fb0
+R acfb1fc3d2b41afa7db1dd81b628bbd3
 U drh
-Z 714853e59d436eb6b69d3e7abbbbb4c3
+Z 3db5ecf0eb5f7fb4a1980c5de63d9edb
index a157281c5e81412b4989ce496186254349b14f54..e6708f159cda808a5cf95611dbd7d1eecd3fcc91 100644 (file)
@@ -1 +1 @@
-97a0fb780ea1992c4d681cc0301bbfa1a06c2fb0
\ No newline at end of file
+2d41caec807a6ab83b67e59c849ebbda004f2869
\ No newline at end of file
index bb950efb9dcc88c6c1c2b58f22ed1d78a1a5e675..4b29cc187e81745695a54544696aad3da21eba7a 100644 (file)
@@ -24,7 +24,7 @@
 ** This file contains C code routines that are called by the parser
 ** when syntax rules are reduced.
 **
-** $Id: build.c,v 1.8 2000/05/30 17:30:36 drh Exp $
+** $Id: build.c,v 1.9 2000/05/30 19:22:26 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -883,20 +883,21 @@ int sqliteExprResolveIds(Parse *pParse, IdList *pTabList, Expr *pExpr){
     case TK_ID: {
       int cnt = 0;   /* Number of matches */
       int i;         /* Loop counter */
-      char *z = pExpr->token.z;
-      int n = pExpr->token.n;
+      char *z = 0;
+      sqliteSetNString(&z, pExpr->token.z, pExpr->token.n, 0);
       for(i=0; i<pTabList->nId; i++){
         int j;
         Table *pTab = pTabList->a[i].pTab;
         if( pTab==0 ) continue;
         for(j=0; j<pTab->nCol; j++){
-          if( sqliteStrNICmp(pTab->azCol[j], z, n)==0 ){
+          if( sqliteStrICmp(pTab->azCol[j], z)==0 ){
             cnt++;
             pExpr->iTable = i;
             pExpr->iField = j;
           }
         }
       }
+      sqliteFree(z);
       if( cnt==0 ){
         sqliteSetNString(&pParse->zErrMsg, "no such field: ", -1,  
           pExpr->token.z, pExpr->token.n, 0);
@@ -918,14 +919,16 @@ int sqliteExprResolveIds(Parse *pParse, IdList *pTabList, Expr *pExpr){
       int i;         /* Loop counter */
       Expr *pLeft, *pRight;    /* Left and right subbranches of the expr */
       int n;                   /* Length of an identifier */
-      char *z;                 /* Text of an identifier */
+      char *zLeft, *zRight;    /* Text of an identifier */
 
       pLeft = pExpr->pLeft;
       pRight = pExpr->pRight;
       assert( pLeft && pLeft->op==TK_ID );
       assert( pRight && pRight->op==TK_ID );
-      n = pRight->token.n;
-      z = pRight->token.z;      
+      zLeft = 0;
+      sqliteSetNString(&zLeft, pLeft->token.z, pLeft->token.n, 0);
+      zRight = 0;
+      sqliteSetNString(&zRight, pRight->token.z, pRight->token.n, 0);
       for(i=0; i<pTabList->nId; i++){
         int j;
         char *zTab;
@@ -936,23 +939,27 @@ int sqliteExprResolveIds(Parse *pParse, IdList *pTabList, Expr *pExpr){
         }else{
           zTab = pTab->zName;
         }
-        if( sqliteStrNICmp(zTab, pLeft->token.z, pLeft->token.n)!=0 ) continue;
+        if( sqliteStrICmp(zTab, zLeft)!=0 ) continue;
         for(j=0; j<pTab->nCol; j++){
-          if( sqliteStrNICmp(pTab->azCol[j], z, n)==0 ){
+          if( sqliteStrICmp(pTab->azCol[j], zRight)==0 ){
             cnt++;
             pExpr->iTable = i;
             pExpr->iField = j;
           }
         }
       }
+      sqliteFree(zLeft);
+      sqliteFree(zRight);
       if( cnt==0 ){
         sqliteSetNString(&pParse->zErrMsg, "no such field: ", -1,  
-          pLeft->token.z, pLeft->token.n, ".", 1, z, n, 0);
+          pLeft->token.z, pLeft->token.n, ".", 1, 
+          pRight->token.z, pRight->token.n, 0);
         pParse->nErr++;
         return 1;
       }else if( cnt>1 ){
         sqliteSetNString(&pParse->zErrMsg, "ambiguous field name: ", -1,  
-          pExpr->token.z, pExpr->token.n, ".", 1, z, n, 0);
+          pLeft->token.z, pLeft->token.n, ".", 1,
+          pRight->token.z, pRight->token.n, 0);
         pParse->nErr++;
         return 1;
       }