aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 93e10b6e4..936a7587f 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -331,9 +331,6 @@ static int lookupName(
sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab);
}
}
- if( 0==(cntTab++) ){
- pMatch = pItem;
- }
hCol = sqlite3StrIHash(zCol);
for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
if( pCol->hName==hCol && sqlite3StrICmp(pCol->zName, zCol)==0 ){
@@ -352,6 +349,10 @@ static int lookupName(
break;
}
}
+ if( 0==cnt && VisibleRowid(pTab) ){
+ cntTab++;
+ pMatch = pItem;
+ }
}
if( pMatch ){
pExpr->iTable = pMatch->iCursor;