diff options
author | drh <> | 2022-04-17 18:46:17 +0000 |
---|---|---|
committer | drh <> | 2022-04-17 18:46:17 +0000 |
commit | fe146997650b13b4adc306dcecc9c3617d2e326a (patch) | |
tree | 69182a827463c61f5c8556c03bdebff0144b6cd9 /src/resolve.c | |
parent | 6fda176ba61b0a37ca70ec9fdf3ed9e80732ab8c (diff) | |
download | sqlite-fe146997650b13b4adc306dcecc9c3617d2e326a.tar.gz sqlite-fe146997650b13b4adc306dcecc9c3617d2e326a.zip |
Further improvements to USING() processing for RIGHT and FULL JOINs. All
currently known issues are now resolved. Performace is improved.
FossilOrigin-Name: 9fd3f22e2228dfba127f6ffe549109f3a4e910fa124adcc9c5483931bd6d5cd7
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/resolve.c b/src/resolve.c index 09b16f1ad..0f0b85306 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -115,22 +115,6 @@ static void resolveAlias( } } - -/* -** Return TRUE if the name zCol occurs anywhere in the USING clause. -** -** Return FALSE if the USING clause is NULL or if it does not contain -** zCol. -*/ -static int nameInUsingClause(IdList *pUsing, const char *zCol){ - int k; - assert( pUsing!=0 ); - for(k=0; k<pUsing->nId; k++){ - if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1; - } - return 0; -} - /* ** Subqueries stores the original database, table and column names for their ** result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN". @@ -338,7 +322,7 @@ static int lookupName( if( sqlite3MatchEName(&pEList->a[j], zCol, zTab, zDb) ){ if( cnt>0 ){ if( pItem->fg.isUsing==0 - || !nameInUsingClause(pItem->u3.pUsing, zCol) + || sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0 ){ sqlite3ExprListDelete(db, pFJMatch); pFJMatch = 0; @@ -392,7 +376,7 @@ static int lookupName( ){ if( cnt>0 ){ if( pItem->fg.isUsing==0 - || !nameInUsingClause(pItem->u3.pUsing, zCol) + || sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0 ){ sqlite3ExprListDelete(db, pFJMatch); pFJMatch = 0; |