mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix a name resolution issue with CTEs.
FossilOrigin-Name: 4fa8235dd59cd683d6c6c97bfe181a9637be7c054d435323c903b9dbd74aff02
This commit is contained in:
@ -5823,9 +5823,10 @@ static int resolveFromTermToCte(
|
||||
assert( pRecTerm->pPrior!=0 );
|
||||
for(i=0; i<pSrc->nSrc; i++){
|
||||
SrcItem *pItem = &pSrc->a[i];
|
||||
if( ((pItem->fg.fixedSchema==0 && pItem->u4.zDatabase==0)
|
||||
|| pItem->fg.hadSchema==0)
|
||||
&& pItem->zName!=0
|
||||
if( pItem->zName!=0
|
||||
&& !pItem->fg.hadSchema
|
||||
&& ALWAYS( !pItem->fg.isSubquery )
|
||||
&& (pItem->fg.fixedSchema || pItem->u4.zDatabase==0)
|
||||
&& 0==sqlite3StrICmp(pItem->zName, pCte->zName)
|
||||
){
|
||||
pItem->pSTab = pTab;
|
||||
|
Reference in New Issue
Block a user