diff options
author | dan <Dan Kennedy> | 2021-07-01 18:19:17 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2021-07-01 18:19:17 +0000 |
commit | b9248ef5c7b5409ab39189e3d29951348f4a53ee (patch) | |
tree | 56658036b7128d3828dac781059f7e3af2ead11f /src/resolve.c | |
parent | 3832ac9f515106b11f2dad1e1768664cb272ce75 (diff) | |
download | sqlite-b9248ef5c7b5409ab39189e3d29951348f4a53ee.tar.gz sqlite-b9248ef5c7b5409ab39189e3d29951348f4a53ee.zip |
Allow unqualified "rowid" references to be used in join queries, provided that only one of the source objects has a rowid.
FossilOrigin-Name: d4097364c511709b1874881a0c036640777d1f724165416adf6f53a41f8c6e40
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 7 |
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; |