Further enhancements and fixes for explain query plan.
FossilOrigin-Name: 73c93f5a2a32ee8c5d07c9ba33b2641e72626627
diff --git a/src/expr.c b/src/expr.c
index ab66e9f..a88208b 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1600,6 +1600,16 @@
assert( testAddr>0 || pParse->db->mallocFailed );
}
+#ifndef SQLITE_OMIT_EXPLAIN
+ if( pParse->explain==2 ){
+ char *zMsg = sqlite3MPrintf(
+ pParse->db, "EXECUTE %s%s SUBQUERY %d", testAddr?"":"CORRELATED ",
+ pExpr->op==TK_IN?"LIST":"SCALAR", pParse->iNextSelectId
+ );
+ sqlite3VdbeAddOp4(v, OP_Explain, pParse->iSelectId, 0, 0, zMsg, P4_DYNAMIC);
+ }
+#endif
+
switch( pExpr->op ){
case TK_IN: {
char affinity; /* Affinity of the LHS of the IN */