aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
diff options
context:
space:
mode:
authordrh <>2022-04-19 09:39:39 +0000
committerdrh <>2022-04-19 09:39:39 +0000
commit2e61588931976d27935b49352ae606d23a38c69b (patch)
treef5f6d27f504ada87a4884faf079d6563eb830aea /src/resolve.c
parentd737b16f922e6d14c2607ee2e7a91d255951c6e5 (diff)
downloadsqlite-2e61588931976d27935b49352ae606d23a38c69b.tar.gz
sqlite-2e61588931976d27935b49352ae606d23a38c69b.zip
Remove unnecessary cases for the resolver.
FossilOrigin-Name: 5bc9aa68e2f938f6a70dd4b08703fe52416d17efe461ec65d37332b57b827fdd
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 76e635acf..4d5e23dff 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -322,12 +322,11 @@ static int lookupName(
if( pItem->fg.isUsing==0
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0
){
+ /* Two or more tables have the same column name which is
+ ** not joined by USING. This is an error. Signal as much
+ ** by clearing pFJMatch and letting cnt go above 1. */
sqlite3ExprListDelete(db, pFJMatch);
pFJMatch = 0;
- if( pItem->fg.jointype & JT_LTORJ ){
- cnt++;
- continue;
- }
}else
if( (pItem->fg.jointype & JT_RIGHT)==0 ){
/* An INNER or LEFT JOIN. Use the left-most table */
@@ -376,12 +375,11 @@ static int lookupName(
if( pItem->fg.isUsing==0
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0
){
+ /* Two or more tables have the same column name which is
+ ** not joined by USING. This is an error. Signal as much
+ ** by clearing pFJMatch and letting cnt go above 1. */
sqlite3ExprListDelete(db, pFJMatch);
pFJMatch = 0;
- if( pItem->fg.jointype & JT_LTORJ ){
- cnt++;
- continue;
- }
}else
if( (pItem->fg.jointype & JT_RIGHT)==0 ){
/* An INNER or LEFT JOIN. Use the left-most table */