-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
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
** 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"
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);
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;
}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;
}