aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <>2022-04-14 16:34:07 +0000
committerdrh <>2022-04-14 16:34:07 +0000
commit2c31c00bfa7001f9d775a5d137da51c5b2ce78f4 (patch)
treec768f60225f5df4410b7b61abd45c9c2086919d1 /src/expr.c
parent37f5584a2fc62560333d86a533d6aee0c4589d6a (diff)
downloadsqlite-2c31c00bfa7001f9d775a5d137da51c5b2ce78f4.tar.gz
sqlite-2c31c00bfa7001f9d775a5d137da51c5b2ce78f4.zip
Rerun the subroutines that compute row-values if necessary from within
the RIGHT JOIN body subroutine. FossilOrigin-Name: 9b9038bcd0ab5c4f01661456635526cef764f854ff24018a5e6e43825d07eb59
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/expr.c b/src/expr.c
index 20adea5dc..79a79ed05 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -4500,16 +4500,18 @@ expr_code_doover:
}
case TK_SELECT_COLUMN: {
int n;
- if( pExpr->pLeft->iTable==0 ){
- pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft);
+ Expr *pLeft = pExpr->pLeft;
+ if( pLeft->iTable==0 || pParse->withinRJSubrtn > pLeft->op2 ){
+ pLeft->iTable = sqlite3CodeSubselect(pParse, pLeft);
+ pLeft->op2 = pParse->withinRJSubrtn;
}
- assert( pExpr->pLeft->op==TK_SELECT || pExpr->pLeft->op==TK_ERROR );
- n = sqlite3ExprVectorSize(pExpr->pLeft);
+ assert( pLeft->op==TK_SELECT || pLeft->op==TK_ERROR );
+ n = sqlite3ExprVectorSize(pLeft);
if( pExpr->iTable!=n ){
sqlite3ErrorMsg(pParse, "%d columns assigned %d values",
pExpr->iTable, n);
}
- return pExpr->pLeft->iTable + pExpr->iColumn;
+ return pLeft->iTable + pExpr->iColumn;
}
case TK_IN: {
int destIfFalse = sqlite3VdbeMakeLabel(pParse);