diff options
author | drh <> | 2022-04-07 01:11:13 +0000 |
---|---|---|
committer | drh <> | 2022-04-07 01:11:13 +0000 |
commit | d44f8b2385eeb97d799fe5172c7514972c6f3359 (patch) | |
tree | 0350d9b592093c18ddbd7eb5c8363e2dae5ba206 /src/resolve.c | |
parent | 200adc9e75fdc08beaf70536d3983b3434e45ded (diff) | |
download | sqlite-d44f8b2385eeb97d799fe5172c7514972c6f3359.tar.gz sqlite-d44f8b2385eeb97d799fe5172c7514972c6f3359.zip |
Improved technique for parsing the ON and USING clauses of a join is faster
and uses less memory.
FossilOrigin-Name: 158156a3e3d50042cafc75dea3aaaa68b1f2efb9c3d178518ea6e68e32e0d21c
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/resolve.c b/src/resolve.c index 480694f6f..30785ca70 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -123,11 +123,10 @@ static void resolveAlias( ** zCol. */ static int nameInUsingClause(IdList *pUsing, const char *zCol){ - if( pUsing ){ - int k; - for(k=0; k<pUsing->nId; k++){ - if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1; - } + int k; + assert( pUsing!=0 ); + for(k=0; k<pUsing->nId; k++){ + if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1; } return 0; } @@ -346,7 +345,11 @@ static int lookupName( */ if( cnt==1 ){ if( pItem->fg.jointype & JT_NATURAL ) continue; - if( nameInUsingClause(pItem->pUsing, zCol) ) continue; + if( pItem->fg.isUsing + && nameInUsingClause(pItem->u3.pUsing, zCol) + ){ + continue; + } } cnt++; pMatch = pItem; |