Ensure that all necessary row-value subqueries are invoked while running

the right-join post processing.

FossilOrigin-Name: e4e71b4cd4c026fc36f0da1703e6237e6ddd8ff2e08dc3c0011632b9e63098cd
This commit is contained in:
drh
2022-06-01 15:53:11 +00:00
parent 0f4b534b60
commit a5d06a3d54
4 changed files with 22 additions and 10 deletions
+3 -2
View File
@@ -6034,6 +6034,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
SrcList *pTabList = pWInfo->pTabList;
sqlite3 *db = pParse->db;
int iEnd = sqlite3VdbeCurrentAddr(v);
int nRJ = 0;
/* Generate loop termination code.
*/
@@ -6050,8 +6051,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
pRJ->endSubrtn = sqlite3VdbeCurrentAddr(v);
sqlite3VdbeAddOp3(v, OP_Return, pRJ->regReturn, pRJ->addrSubrtn, 1);
VdbeCoverage(v);
assert( pParse->withinRJSubrtn>0 );
pParse->withinRJSubrtn--;
nRJ++;
}
pLoop = pLevel->pWLoop;
if( pLevel->op!=OP_Noop ){
@@ -6332,5 +6332,6 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
*/
pParse->nQueryLoop = pWInfo->savedNQueryLoop;
whereInfoFree(db, pWInfo);
pParse->withinRJSubrtn -= nRJ;
return;
}