aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordan <Dan Kennedy>2022-12-06 18:48:06 +0000
committerdan <Dan Kennedy>2022-12-06 18:48:06 +0000
commit2adb309ead2d8a794a65b374c76d7c7246c95a69 (patch)
tree7e4ac3759204911059080161acf79085e29dc942 /src/vdbeapi.c
parent29226fc023767ddbb078ae37b64e1a4d8accf111 (diff)
downloadsqlite-2adb309ead2d8a794a65b374c76d7c7246c95a69.tar.gz
sqlite-2adb309ead2d8a794a65b374c76d7c7246c95a69.zip
Have sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not just virtual tables ones. The value returned is the sum of the NCYCLE counts for the various opcodes that move or read data from the table or index cursor associated with the loop.
FossilOrigin-Name: 9499b2f51e8174c6b8a67840c92ba23b7dd1dc8dc2b91fca0c5dc07b71662149
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 0644cffa5..028eb7fe6 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -15,6 +15,7 @@
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
+#include "opcodes.h"
#ifndef SQLITE_OMIT_DEPRECATED
/*
@@ -2225,10 +2226,7 @@ int sqlite3_stmt_scanstatus_v2(
for(iOp=0; iOp<p->nOp; iOp++){
Op *pOp = &p->aOp[iOp];
if( pOp->p1!=iEnd ) continue;
- if( pOp->opcode!=OP_VFilter && pOp->opcode!=OP_VColumn
- && pOp->opcode!=OP_Rowid && pOp->opcode!=OP_VOpen
- && pOp->opcode!=OP_VNext
- ){
+ if( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_NCYCLE)==0 ){
continue;
}
res += p->anCycle[iOp];