1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-12 23:22:53 +03:00

Minor refactor of the SrcList object so that it is able to hold the argument

list to a table-valued-function in the FROM clause.

FossilOrigin-Name: b919376147597c4b73421abe5788f893baf1560b
This commit is contained in:
drh
2015-08-19 15:20:00 +00:00
parent 398f872d1f
commit 8a48b9c0b1
12 changed files with 100 additions and 87 deletions

View File

@@ -306,7 +306,7 @@ static int lookupName(
** USING clause, then skip this match.
*/
if( cnt==1 ){
if( pItem->jointype & JT_NATURAL ) continue;
if( pItem->fg.jointype & JT_NATURAL ) continue;
if( nameInUsingClause(pItem->pUsing, zCol) ) continue;
}
cnt++;
@@ -321,8 +321,8 @@ static int lookupName(
pExpr->iTable = pMatch->iCursor;
pExpr->pTab = pMatch->pTab;
/* RIGHT JOIN not (yet) supported */
assert( (pMatch->jointype & JT_RIGHT)==0 );
if( (pMatch->jointype & JT_LEFT)!=0 ){
assert( (pMatch->fg.jointype & JT_RIGHT)==0 );
if( (pMatch->fg.jointype & JT_LEFT)!=0 ){
ExprSetProperty(pExpr, EP_CanBeNull);
}
pSchema = pExpr->pTab->pSchema;
@@ -1215,7 +1215,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){
** parent contexts. After resolving references to expressions in
** pItem->pSelect, check if this value has changed. If so, then
** SELECT statement pItem->pSelect must be correlated. Set the
** pItem->isCorrelated flag if this is the case. */
** pItem->fg.isCorrelated flag if this is the case. */
for(pNC=pOuterNC; pNC; pNC=pNC->pNext) nRef += pNC->nRef;
if( pItem->zName ) pParse->zAuthContext = pItem->zName;
@@ -1224,8 +1224,8 @@ static int resolveSelectStep(Walker *pWalker, Select *p){
if( pParse->nErr || db->mallocFailed ) return WRC_Abort;
for(pNC=pOuterNC; pNC; pNC=pNC->pNext) nRef -= pNC->nRef;
assert( pItem->isCorrelated==0 && nRef<=0 );
pItem->isCorrelated = (nRef!=0);
assert( pItem->fg.isCorrelated==0 && nRef<=0 );
pItem->fg.isCorrelated = (nRef!=0);
}
}