diff options
author | stephan <stephan@noemail.net> | 2022-12-10 05:00:16 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-12-10 05:00:16 +0000 |
commit | 9be7a363ccf8a9bb78dcf390bc1f7bfac1d123b4 (patch) | |
tree | a9741d41dda82abeb5d56f47f474e24af9f96a24 /src/expr.c | |
parent | 412237fba58ccf7a766895d6ae1b7348e760e73d (diff) | |
parent | 8ccef8f27f93b29e3d1a634f928169c8744bc07d (diff) | |
download | sqlite-9be7a363ccf8a9bb78dcf390bc1f7bfac1d123b4.tar.gz sqlite-9be7a363ccf8a9bb78dcf390bc1f7bfac1d123b4.zip |
Merge trunk into wasi-patches branch.
FossilOrigin-Name: 13dade955d46020ab408734123261e9fadb8bccbaf67003b111112af4789d8c0
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index d30ae9766..592e9dd25 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3257,6 +3257,9 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ SelectDest dest; /* How to deal with SELECT result */ int nReg; /* Registers to allocate */ Expr *pLimit; /* New limit expression */ +#ifdef SQLITE_ENABLE_STMT_SCANSTATUS + int addrExplain; /* Address of OP_Explain instruction */ +#endif Vdbe *v = pParse->pVdbe; assert( v!=0 ); @@ -3309,8 +3312,9 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ ** In both cases, the query is augmented with "LIMIT 1". Any ** preexisting limit is discarded in place of the new LIMIT 1. */ - ExplainQueryPlan((pParse, 1, "%sSCALAR SUBQUERY %d", + ExplainQueryPlan2(addrExplain, (pParse, 1, "%sSCALAR SUBQUERY %d", addrOnce?"":"CORRELATED ", pSel->selId)); + sqlite3VdbeScanStatusCounters(v, addrExplain, addrExplain, -1); nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1; sqlite3SelectDestInit(&dest, 0, pParse->nMem+1); pParse->nMem += nReg; @@ -3353,6 +3357,7 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ if( addrOnce ){ sqlite3VdbeJumpHere(v, addrOnce); } + sqlite3VdbeScanStatusRange(v, addrExplain, addrExplain, -1); /* Subroutine return */ assert( ExprUseYSub(pExpr) ); |