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

When resolving names, consider a reference to a recursive CTE column as equivalent to a reference to the outermost name-context. This ensures that correlated sub-queries are correctly identified as such.

FossilOrigin-Name: 61be2da0ae623c1572819481508b044e9d32f294
This commit is contained in:
dan
2014-01-15 18:12:00 +00:00
parent 60e7068d75
commit f43fe6e9f6
7 changed files with 42 additions and 11 deletions

View File

@@ -3551,7 +3551,9 @@ static int withExpand(
if( pCte==pParse->pCte && (pTab = pCte->pTab) ){
/* This is the recursive part of a recursive CTE */
assert( pFrom->pTab==0 && pFrom->isRecursive==0 );
pFrom->pTab = pTab;
pFrom->isRecursive = 1;
pTab->nRef++;
}else{
ExprList *pEList;