aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2006-01-24 12:09:17 +0000
committerdanielk1977 <danielk1977@noemail.net>2006-01-24 12:09:17 +0000
commitf0113000000e3c41c7004a707a974e63c503a6a1 (patch)
tree63f696c660c82f42859f6c85a7506a98bcb39586 /src
parent7246f5b9cb7c45b79d23969474b21ee1518d756a (diff)
downloadsqlite-f0113000000e3c41c7004a707a974e63c503a6a1.tar.gz
sqlite-f0113000000e3c41c7004a707a974e63c503a6a1.zip
Rename some variables to avoid hiding others. Also add "static" to two function signatures that were missing it. (CVS 3024)
FossilOrigin-Name: d86f18a4277ebffb644ba2e574e0b697c8bbf8e4
Diffstat (limited to 'src')
-rw-r--r--src/attach.c18
-rw-r--r--src/build.c10
-rw-r--r--src/date.c10
-rw-r--r--src/delete.c8
-rw-r--r--src/expr.c41
-rw-r--r--src/insert.c16
-rw-r--r--src/os_win.c4
-rw-r--r--src/pager.c15
-rw-r--r--src/printf.c18
-rw-r--r--src/select.c16
-rw-r--r--src/vdbe.c6
-rw-r--r--src/where.c14
12 files changed, 87 insertions, 89 deletions
diff --git a/src/attach.c b/src/attach.c
index 26fc53101..c66b212d1 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
-** $Id: attach.c,v 1.48 2006/01/18 16:51:35 danielk1977 Exp $
+** $Id: attach.c,v 1.49 2006/01/24 12:09:18 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -33,7 +33,7 @@
**
** will fail because neither abc or def can be resolved.
*/
-int resolveAttachExpr(NameContext *pName, Expr *pExpr)
+static int resolveAttachExpr(NameContext *pName, Expr *pExpr)
{
int rc = SQLITE_OK;
if( pExpr ){
@@ -176,15 +176,15 @@ static void attachFunc(
sqlite3SafetyOff(db);
}
if( rc ){
- int i = db->nDb - 1;
- assert( i>=2 );
- if( db->aDb[i].pBt ){
- sqlite3BtreeClose(db->aDb[i].pBt);
- db->aDb[i].pBt = 0;
- db->aDb[i].pSchema = 0;
+ int iDb = db->nDb - 1;
+ assert( iDb>=2 );
+ if( db->aDb[iDb].pBt ){
+ sqlite3BtreeClose(db->aDb[iDb].pBt);
+ db->aDb[iDb].pBt = 0;
+ db->aDb[iDb].pSchema = 0;
}
sqlite3ResetInternalSchema(db, 0);
- db->nDb = i;
+ db->nDb = iDb;
sqlite3_snprintf(127, zErr, "unable to open database: %s", zFile);
goto attach_error;
}
diff --git a/src/build.c b/src/build.c
index 56be58dba..a25381250 100644
--- a/src/build.c
+++ b/src/build.c
@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.382 2006/01/18 16:51:35 danielk1977 Exp $
+** $Id: build.c,v 1.383 2006/01/24 12:09:19 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -3157,10 +3157,10 @@ void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
assert( pName1->z );
pColl = sqlite3FindCollSeq(db, ENC(db), (char*)pName1->z, pName1->n, 0);
if( pColl ){
- char *z = sqliteStrNDup((const char *)pName1->z, pName1->n);
- if( z ){
- reindexDatabases(pParse, z);
- sqliteFree(z);
+ char *zColl = sqliteStrNDup((const char *)pName1->z, pName1->n);
+ if( zColl ){
+ reindexDatabases(pParse, zColl);
+ sqliteFree(zColl);
}
return;
}
diff --git a/src/date.c b/src/date.c
index bd62e209f..4a09a4f8d 100644
--- a/src/date.c
+++ b/src/date.c
@@ -16,7 +16,7 @@
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.52 2006/01/17 13:21:40 danielk1977 Exp $
+** $Id: date.c,v 1.53 2006/01/24 12:09:19 danielk1977 Exp $
**
** NOTES:
**
@@ -818,20 +818,20 @@ static void strftimeFunc(
case 'H': sprintf(&z[j],"%02d",x.h); j+=2; break;
case 'W': /* Fall thru */
case 'j': {
- int n; /* Number of days since 1st day of year */
+ int nDay; /* Number of days since 1st day of year */
DateTime y = x;
y.validJD = 0;
y.M = 1;
y.D = 1;
computeJD(&y);
- n = x.rJD - y.rJD;
+ nDay = x.rJD - y.rJD;
if( zFmt[i]=='W' ){
int wd; /* 0=Monday, 1=Tuesday, ... 6=Sunday */
wd = ((int)(x.rJD+0.5)) % 7;
- sprintf(&z[j],"%02d",(n+7-wd)/7);
+ sprintf(&z[j],"%02d",(nDay+7-wd)/7);
j += 2;
}else{
- sprintf(&z[j],"%03d",n+1);
+ sprintf(&z[j],"%03d",nDay+1);
j += 3;
}
break;
diff --git a/src/delete.c b/src/delete.c
index c742bc4ea..f1b73a93a 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
-** $Id: delete.c,v 1.119 2006/01/18 16:51:35 danielk1977 Exp $
+** $Id: delete.c,v 1.120 2006/01/24 12:09:19 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -210,13 +210,13 @@ void sqlite3DeleteFrom(
/* If counting rows deleted, just count the total number of
** entries in the table. */
int endOfLoop = sqlite3VdbeMakeLabel(v);
- int addr;
+ int addr2;
if( !isView ){
sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead);
}
sqlite3VdbeAddOp(v, OP_Rewind, iCur, sqlite3VdbeCurrentAddr(v)+2);
- addr = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
- sqlite3VdbeAddOp(v, OP_Next, iCur, addr);
+ addr2 = sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);
+ sqlite3VdbeAddOp(v, OP_Next, iCur, addr2);
sqlite3VdbeResolveLabel(v, endOfLoop);
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
}
diff --git a/src/expr.c b/src/expr.c
index 169fdf942..7de7583ad 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.251 2006/01/23 05:50:58 danielk1977 Exp $
+** $Id: expr.c,v 1.252 2006/01/24 12:09:19 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -918,17 +918,17 @@ static int lookupName(
}
if( pTab ){
- int j;
+ int iCol;
Column *pCol = pTab->aCol;
pExpr->pSchema = pTab->pSchema;
cntTab++;
- for(j=0; j < pTab->nCol; j++, pCol++) {
+ for(iCol=0; iCol < pTab->nCol; iCol++, pCol++) {
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
- const char *zColl = pTab->aCol[j].zColl;
+ const char *zColl = pTab->aCol[iCol].zColl;
cnt++;
- pExpr->iColumn = j==pTab->iPKey ? -1 : j;
- pExpr->affinity = pTab->aCol[j].affinity;
+ pExpr->iColumn = iCol==pTab->iPKey ? -1 : iCol;
+ pExpr->affinity = pTab->aCol[iCol].affinity;
pExpr->pColl = sqlite3FindCollSeq(db, ENC(db), zColl,-1, 0);
pExpr->pTab = pTab;
break;
@@ -1077,20 +1077,19 @@ lookupname_end_2:
*/
static int nameResolverStep(void *pArg, Expr *pExpr){
NameContext *pNC = (NameContext*)pArg;
- SrcList *pSrcList;
Parse *pParse;
if( pExpr==0 ) return 1;
assert( pNC!=0 );
- pSrcList = pNC->pSrcList;
pParse = pNC->pParse;
if( ExprHasAnyProperty(pExpr, EP_Resolved) ) return 1;
ExprSetProperty(pExpr, EP_Resolved);
#ifndef NDEBUG
- if( pSrcList && pSrcList->nAlloc>0 ){
+ if( pNC->pSrcList && pNC->pSrcList->nAlloc>0 ){
+ SrcList *pSrcList = pNC->pSrcList;
int i;
- for(i=0; i<pSrcList->nSrc; i++){
+ for(i=0; i<pNC->pSrcList->nSrc; i++){
assert( pSrcList->a[i].iCursor>=0 && pSrcList->a[i].iCursor<pParse->nTab);
}
}
@@ -1380,9 +1379,9 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
*/
if( testAddr>0 && !sqlite3ExprIsConstant(pE2) ){
VdbeOp *aOp = sqlite3VdbeGetOp(v, testAddr-1);
- int i;
- for(i=0; i<3; i++){
- aOp[i].opcode = OP_Noop;
+ int j;
+ for(j=0; j<3; j++){
+ aOp[j].opcode = OP_Noop;
}
testAddr = 0;
}
@@ -1548,16 +1547,16 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){
#ifndef SQLITE_OMIT_CAST
case TK_CAST: {
/* Expressions of the form: CAST(pLeft AS token) */
- int aff, op;
+ int aff, to_op;
sqlite3ExprCode(pParse, pExpr->pLeft);
aff = sqlite3AffinityType(&pExpr->token);
- op = aff - SQLITE_AFF_TEXT + OP_ToText;
- assert( op==OP_ToText || aff!=SQLITE_AFF_TEXT );
- assert( op==OP_ToBlob || aff!=SQLITE_AFF_NONE );
- assert( op==OP_ToNumeric || aff!=SQLITE_AFF_NUMERIC );
- assert( op==OP_ToInt || aff!=SQLITE_AFF_INTEGER );
- assert( op==OP_ToReal || aff!=SQLITE_AFF_REAL );
- sqlite3VdbeAddOp(v, op, 0, 0);
+ to_op = aff - SQLITE_AFF_TEXT + OP_ToText;
+ assert( to_op==OP_ToText || aff!=SQLITE_AFF_TEXT );
+ assert( to_op==OP_ToBlob || aff!=SQLITE_AFF_NONE );
+ assert( to_op==OP_ToNumeric || aff!=SQLITE_AFF_NUMERIC );
+ assert( to_op==OP_ToInt || aff!=SQLITE_AFF_INTEGER );
+ assert( to_op==OP_ToReal || aff!=SQLITE_AFF_REAL );
+ sqlite3VdbeAddOp(v, to_op, 0, 0);
stackChng = 0;
break;
}
diff --git a/src/insert.c b/src/insert.c
index 993da99b0..7899610e2 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
-** $Id: insert.c,v 1.159 2006/01/20 18:10:57 drh Exp $
+** $Id: insert.c,v 1.160 2006/01/24 12:09:19 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -297,20 +297,20 @@ void sqlite3Insert(
*/
if( pTab->autoInc ){
int iCur = pParse->nTab;
- int base = sqlite3VdbeCurrentAddr(v);
+ int addr = sqlite3VdbeCurrentAddr(v);
counterRowid = pParse->nMem++;
counterMem = pParse->nMem++;
sqlite3OpenTable(pParse, iCur, iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
- sqlite3VdbeAddOp(v, OP_Rewind, iCur, base+13);
+ sqlite3VdbeAddOp(v, OP_Rewind, iCur, addr+13);
sqlite3VdbeAddOp(v, OP_Column, iCur, 0);
sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0);
- sqlite3VdbeAddOp(v, OP_Ne, 0x100, base+12);
+ sqlite3VdbeAddOp(v, OP_Ne, 0x100, addr+12);
sqlite3VdbeAddOp(v, OP_Rowid, iCur, 0);
sqlite3VdbeAddOp(v, OP_MemStore, counterRowid, 1);
sqlite3VdbeAddOp(v, OP_Column, iCur, 1);
sqlite3VdbeAddOp(v, OP_MemStore, counterMem, 1);
- sqlite3VdbeAddOp(v, OP_Goto, 0, base+13);
- sqlite3VdbeAddOp(v, OP_Next, iCur, base+4);
+ sqlite3VdbeAddOp(v, OP_Goto, 0, addr+13);
+ sqlite3VdbeAddOp(v, OP_Next, iCur, addr+4);
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
}
#endif /* SQLITE_OMIT_AUTOINCREMENT */
@@ -680,10 +680,10 @@ void sqlite3Insert(
*/
if( pTab->autoInc ){
int iCur = pParse->nTab;
- int base = sqlite3VdbeCurrentAddr(v);
+ int addr = sqlite3VdbeCurrentAddr(v);
sqlite3OpenTable(pParse, iCur, iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
sqlite3VdbeAddOp(v, OP_MemLoad, counterRowid, 0);
- sqlite3VdbeAddOp(v, OP_NotNull, -1, base+7);
+ sqlite3VdbeAddOp(v, OP_NotNull, -1, addr+7);
sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
sqlite3VdbeAddOp(v, OP_NewRowid, iCur, 0);
sqlite3VdbeOp3(v, OP_String8, 0, 0, pTab->zName, 0);
diff --git a/src/os_win.c b/src/os_win.c
index 044618624..944d6e29d 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -514,7 +514,7 @@ int sqlite3WinFileExists(const char *zFilename){
}
/* Forward declaration */
-int allocateWinFile(winFile *pInit, OsFile **pId);
+static int allocateWinFile(winFile *pInit, OsFile **pId);
/*
** Attempt to open a file for both reading and writing. If that
@@ -1289,7 +1289,7 @@ static const IoMethod sqlite3WinIoMethod = {
** to the value given in pInit and return a pointer to the new
** OsFile. If we run out of memory, close the file and return NULL.
*/
-int allocateWinFile(winFile *pInit, OsFile **pId){
+static int allocateWinFile(winFile *pInit, OsFile **pId){
winFile *pNew;
pNew = sqliteMalloc( sizeof(*pNew) );
if( pNew==0 ){
diff --git a/src/pager.c b/src/pager.c
index 6d9857e02..9681ab5a1 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.254 2006/01/23 16:21:06 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.255 2006/01/24 12:09:19 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -1444,17 +1444,17 @@ static int pager_stmt_playback(Pager *pPager){
}
while( pPager->journalOff < szJ ){
- u32 nRec;
+ u32 nJRec; /* Number of Journal Records */
u32 dummy;
- rc = readJournalHdr(pPager, szJ, &nRec, &dummy);
+ rc = readJournalHdr(pPager, szJ, &nJRec, &dummy);
if( rc!=SQLITE_OK ){
assert( rc!=SQLITE_DONE );
goto end_stmt_playback;
}
- if( nRec==0 ){
- nRec = (szJ - pPager->journalOff) / (pPager->pageSize+8);
+ if( nJRec==0 ){
+ nJRec = (szJ - pPager->journalOff) / (pPager->pageSize+8);
}
- for(i=nRec-1; i>=0 && pPager->journalOff < szJ; i--){
+ for(i=nJRec-1; i>=0 && pPager->journalOff < szJ; i--){
rc = pager_playback_one_page(pPager, pPager->jfd, 1);
assert( rc!=SQLITE_DONE );
if( rc!=SQLITE_OK ) goto end_stmt_playback;
@@ -2556,8 +2556,6 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
** database file, then it either needs to be played back or deleted.
*/
if( hasHotJournal(pPager) ){
- int rc;
-
/* Get an EXCLUSIVE lock on the database file. At this point it is
** important that a RESERVED lock is not obtained on the way to the
** EXCLUSIVE lock. If it were, another process might open the
@@ -2680,7 +2678,6 @@ int sqlite3pager_get(Pager *pPager, Pgno pgno, void **ppPage){
if( sqlite3pager_pagecount(pPager)<(int)pgno ){
memset(PGHDR_TO_DATA(pPg), 0, pPager->pageSize);
}else{
- int rc;
assert( MEMDB==0 );
rc = sqlite3OsSeek(pPager->fd, (pgno-1)*(i64)pPager->pageSize);
if( rc==SQLITE_OK ){
diff --git a/src/printf.c b/src/printf.c
index 8f1b2ac4b..261a55414 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -596,13 +596,13 @@ static int vxprintf(
break;
case etSQLESCAPE:
case etSQLESCAPE2: {
- int i, j, n, c, isnull;
+ int i, j, n, ch, isnull;
int needQuote;
- char *arg = va_arg(ap,char*);
- isnull = arg==0;
- if( isnull ) arg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
- for(i=n=0; (c=arg[i])!=0; i++){
- if( c=='\'' ) n++;
+ char *escarg = va_arg(ap,char*);
+ isnull = escarg==0;
+ if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
+ for(i=n=0; (ch=escarg[i])!=0; i++){
+ if( ch=='\'' ) n++;
}
needQuote = !isnull && xtype==etSQLESCAPE2;
n += i + 1 + needQuote*2;
@@ -614,9 +614,9 @@ static int vxprintf(
}
j = 0;
if( needQuote ) bufpt[j++] = '\'';
- for(i=0; (c=arg[i])!=0; i++){
- bufpt[j++] = c;
- if( c=='\'' ) bufpt[j++] = c;
+ for(i=0; (ch=escarg[i])!=0; i++){
+ bufpt[j++] = ch;
+ if( ch=='\'' ) bufpt[j++] = ch;
}
if( needQuote ) bufpt[j++] = '\'';
bufpt[j] = 0;
diff --git a/src/select.c b/src/select.c
index d5c525466..14d8a00c1 100644
--- a/src/select.c
+++ b/src/select.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.300 2006/01/23 18:42:21 drh Exp $
+** $Id: select.c,v 1.301 2006/01/24 12:09:19 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -21,7 +21,7 @@
** Delete all the content of a Select structure but do not deallocate
** the select structure itself.
*/
-void clearSelect(Select *p){
+static void clearSelect(Select *p){
sqlite3ExprListDelete(p->pEList);
sqlite3SrcListDelete(p->pSrc);
sqlite3ExprDelete(p->pWhere);
@@ -557,9 +557,9 @@ static int selectInnerLoop(
** case the order does matter */
pushOntoSorter(pParse, pOrderBy, p);
}else{
- char aff = (iParm>>16)&0xFF;
- aff = sqlite3CompareAffinity(pEList->a[0].pExpr, aff);
- sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &aff, 1);
+ char affinity = (iParm>>16)&0xFF;
+ affinity = sqlite3CompareAffinity(pEList->a[0].pExpr, affinity);
+ sqlite3VdbeOp3(v, OP_MakeRecord, 1, 0, &affinity, 1);
sqlite3VdbeAddOp(v, OP_IdxInsert, (iParm&0x0000FFFF), 0);
}
sqlite3VdbeJumpHere(v, addr2);
@@ -1078,7 +1078,6 @@ static int prepSelectStmt(Parse *pParse, Select *p){
int i, j, k, rc;
SrcList *pTabList;
ExprList *pEList;
- Table *pTab;
struct SrcList_item *pFrom;
if( p==0 || p->pSrc==0 || sqlite3MallocFailed() ){
@@ -1097,6 +1096,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
** then create a transient table structure to describe the subquery.
*/
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
+ Table *pTab;
if( pFrom->pTab!=0 ){
/* This statement has already been prepared. There is no need
** to go further. */
@@ -1220,7 +1220,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
}
tableSeen = 1;
for(j=0; j<pTab->nCol; j++){
- Expr *pExpr, *pLeft, *pRight;
+ Expr *pExpr, *pRight;
char *zName = pTab->aCol[j].zName;
if( i>0 ){
@@ -1241,7 +1241,7 @@ static int prepSelectStmt(Parse *pParse, Select *p){
if( pRight==0 ) break;
setToken(&pRight->token, zName);
if( zTabName && (longNames || pTabList->nSrc>1) ){
- pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
+ Expr *pLeft = sqlite3Expr(TK_ID, 0, 0, 0);
pExpr = sqlite3Expr(TK_DOT, pLeft, pRight, 0);
if( pExpr==0 ) break;
setToken(&pLeft->token, zTabName);
diff --git a/src/vdbe.c b/src/vdbe.c
index f3b1a1174..8b0850736 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.537 2006/01/23 17:43:53 drh Exp $
+** $Id: vdbe.c,v 1.538 2006/01/24 12:09:20 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -2993,7 +2993,9 @@ case OP_IsUnique: { /* no-push */
assert( pCx->deferredMoveto==0 );
pCx->cacheStatus = CACHE_STALE;
rc = sqlite3BtreeMoveto(pCrsr, zKey, len, &res);
- if( rc!=SQLITE_OK ) goto abort_due_to_error;
+ if( rc!=SQLITE_OK ){
+ goto abort_due_to_error;
+ }
if( res<0 ){
rc = sqlite3BtreeNext(pCrsr, &res);
if( res ){
diff --git a/src/where.c b/src/where.c
index 9d21b5f08..31eeaeeb5 100644
--- a/src/where.c
+++ b/src/where.c
@@ -16,7 +16,7 @@
** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer".
**
-** $Id: where.c,v 1.202 2006/01/23 13:22:10 drh Exp $
+** $Id: where.c,v 1.203 2006/01/24 12:09:20 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -424,7 +424,7 @@ static WhereTerm *findTerm(
Expr *pX = pTerm->pExpr;
CollSeq *pColl;
char idxaff;
- int k;
+ int j;
Parse *pParse = pWC->pParse;
idxaff = pIdx->pTable->aCol[iColumn].affinity;
@@ -438,9 +438,9 @@ static WhereTerm *findTerm(
pColl = pParse->db->pDfltColl;
}
}
- for(k=0; k<pIdx->nColumn && pIdx->aiColumn[k]!=iColumn; k++){}
- assert( k<pIdx->nColumn );
- if( sqlite3StrICmp(pColl->zName, pIdx->azColl[k]) ) continue;
+ for(j=0; j<pIdx->nColumn && pIdx->aiColumn[j]!=iColumn; j++){}
+ assert( j<pIdx->nColumn );
+ if( sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue;
}
return pTerm;
}
@@ -2085,14 +2085,14 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
** reference the index.
*/
if( pLevel->flags & WHERE_IDX_ONLY ){
- int i, j, last;
+ int k, j, last;
VdbeOp *pOp;
Index *pIdx = pLevel->pIdx;
assert( pIdx!=0 );
pOp = sqlite3VdbeGetOp(v, pWInfo->iTop);
last = sqlite3VdbeCurrentAddr(v);
- for(i=pWInfo->iTop; i<last; i++, pOp++){
+ for(k=pWInfo->iTop; k<last; k++, pOp++){
if( pOp->p1!=pLevel->iTabCur ) continue;
if( pOp->opcode==OP_Column ){
pOp->p1 = pLevel->iIdxCur;