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

Proposed fix for an infinite loop bug in the WITH clause semantic analysis

logic.

FossilOrigin-Name: 028475cb17a4b50baf0e9aba9bd3403d0a5d03b0
This commit is contained in:
drh
2015-11-07 17:48:21 +00:00
parent 2476a6f2cb
commit 6e7722669e
6 changed files with 79 additions and 16 deletions

View File

@@ -4003,12 +4003,12 @@ static struct Cte *searchWith(
** statement with which it is associated.
*/
void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){
assert( bFree==0 || pParse->pWith==0 );
assert( bFree==0 || (pParse->pWith==0 && pParse->pWithToFree==0) );
if( pWith ){
assert( pParse->pWith!=pWith );
pWith->pOuter = pParse->pWith;
pParse->pWith = pWith;
pParse->bFreeWith = bFree;
if( bFree ) pParse->pWithToFree = pWith;
}
}
@@ -4101,6 +4101,7 @@ static int withExpand(
pSavedWith = pParse->pWith;
pParse->pWith = pWith;
sqlite3WalkSelect(pWalker, bMayRecursive ? pSel->pPrior : pSel);
pParse->pWith = pWith;
for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior);
pEList = pLeft->pEList;