1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Fix for the previous fix in the case where a UNION ALL sub-query is joined against some other compound query.

FossilOrigin-Name: 63c5cfb9ae8f4598a523bed2a60c0e69172179952961a573113fcf756c06551d
This commit is contained in:
dan
2020-12-18 18:04:44 +00:00
parent 964fa26e0c
commit d131b51cbd
4 changed files with 59 additions and 13 deletions

View File

@@ -3673,11 +3673,10 @@ static void srclistRenumberCursors(
struct SrcList_item *pItem;
for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
if( i!=iExcept ){
int iNew = pParse->nTab++;
aCsrMap[pItem->iCursor] = iNew;
pItem->iCursor = iNew;
if( pItem->pSelect ){
srclistRenumberCursors(pParse, aCsrMap, pItem->pSelect->pSrc, -1);
Select *p;
pItem->iCursor = aCsrMap[pItem->iCursor] = pParse->nTab++;
for(p=pItem->pSelect; p; p=p->pPrior){
srclistRenumberCursors(pParse, aCsrMap, p->pSrc, -1);
}
}
}