aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-12-10 15:55:01 +0000
committerdrh <drh@noemail.net>2011-12-10 15:55:01 +0000
commit678a9aa7bdae01e70cb615058117b136eb045fbe (patch)
treeb972d1674fbd74d0d0b055ef14422b54e5c1adaf /src/main.c
parent3a0c9c0298776f8a3ca842fe555979768fdabac7 (diff)
parenta5eec8c8c3b44b802d6571a436ec3b3bffd69f4c (diff)
downloadsqlite-678a9aa7bdae01e70cb615058117b136eb045fbe.tar.gz
sqlite-678a9aa7bdae01e70cb615058117b136eb045fbe.zip
Import the experimental parse-tree explainer, with fixes, from the
tree-explain branch. FossilOrigin-Name: bcbc7152d49107afa926c8950360c61a6cf3d244
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 8562a9072..d6dc0c79e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2936,6 +2936,22 @@ int sqlite3_test_control(int op, ...){
break;
}
+#if defined(SQLITE_ENABLE_TREE_EXPLAIN)
+ /* sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT,
+ ** sqlite3_stmt*,const char**);
+ **
+ ** If compiled with SQLITE_ENABLE_TREE_EXPLAIN, each sqlite3_stmt holds
+ ** a string that describes the optimized parse tree. This test-control
+ ** returns a pointer to that string.
+ */
+ case SQLITE_TESTCTRL_EXPLAIN_STMT: {
+ sqlite3_stmt *pStmt = va_arg(ap, sqlite3_stmt*);
+ const char **pzRet = va_arg(ap, const char**);
+ *pzRet = sqlite3VdbeExplanation((Vdbe*)pStmt);
+ break;
+ }
+#endif
+
}
va_end(ap);
#endif /* SQLITE_OMIT_BUILTIN_TEST */