aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordan <Dan Kennedy>2023-06-30 18:23:53 +0000
committerdan <Dan Kennedy>2023-06-30 18:23:53 +0000
commit4cd3a59a79ef2864bc071a2e7219720f8957673c (patch)
tree22fbd01e802745d5203fbd31a5ca3777eaf8c5c1 /src/wherecode.c
parent07d76f7b95730982e7aa1526cf44b872c6a864cd (diff)
downloadsqlite-4cd3a59a79ef2864bc071a2e7219720f8957673c.tar.gz
sqlite-4cd3a59a79ef2864bc071a2e7219720f8957673c.zip
Improve support for sqlite3_stmt_scanstatus_v2() profiling of sub-queries implemented as co-routines.
FossilOrigin-Name: 4e8718dc35dbbaf75f17265a88d14acd9750dc75efbadf41377f9c97e732009c
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index 5d611f1f1..47ce36ce3 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -315,6 +315,12 @@ void sqlite3WhereAddScanStatus(
if( wsFlags & WHERE_INDEXED ){
sqlite3VdbeScanStatusRange(v, addrExplain, -1, pLvl->iIdxCur);
}
+ }else{
+ int addr = pSrclist->a[pLvl->iFrom].addrFillSub;
+ VdbeOp *pOp = sqlite3VdbeGetOp(v, addr-1);
+ assert( sqlite3VdbeDb(v)->mallocFailed || pOp->opcode==OP_InitCoroutine );
+ assert( sqlite3VdbeDb(v)->mallocFailed || pOp->p2>addr );
+ sqlite3VdbeScanStatusRange(v, addrExplain, addr, pOp->p2-1);
}
}
}