aboutsummaryrefslogtreecommitdiff
path: root/src/sqliteInt.h
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-12-04 01:17:57 +0000
committerdrh <drh@noemail.net>2020-12-04 01:17:57 +0000
commitc0622a4d0307a30a9eb2aa650722aef1340f04cb (patch)
tree2f0e25db7bc94623e0a25d9ddefc9b7db893597d /src/sqliteInt.h
parent384f5c26f48b92e8bfcb168381d4a8caf3ea59e7 (diff)
downloadsqlite-c0622a4d0307a30a9eb2aa650722aef1340f04cb.tar.gz
sqlite-c0622a4d0307a30a9eb2aa650722aef1340f04cb.zip
Alternative implementation of ".selecttrace" and ".wheretrace" that uses
a test-control rather than global variables. FossilOrigin-Name: d36d6f2923a2393c751c0ac7634433453be20df7567fd914e57cbb1ae15f68b2
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r--src/sqliteInt.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 467062277..1efa62142 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -984,15 +984,14 @@ typedef INT16_TYPE LogEst;
** SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not
** the Select query generator tracing logic is turned on.
*/
-#if defined(SQLITE_ENABLE_SELECTTRACE)
-# define SELECTTRACE_ENABLED 1
-#else
-# define SELECTTRACE_ENABLED 0
+#if !defined(SQLITE_AMALGAMATION)
+extern u32 sqlite3SelectTrace;
#endif
-#if defined(SQLITE_ENABLE_SELECTTRACE)
+#if defined(SQLITE_DEBUG) \
+ && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_SELECTTRACE))
# define SELECTTRACE_ENABLED 1
# define SELECTTRACE(K,P,S,X) \
- if(sqlite3_unsupported_selecttrace&(K)) \
+ if(sqlite3SelectTrace&(K)) \
sqlite3DebugPrintf("%u/%d/%p: ",(S)->selId,(P)->addrExplain,(S)),\
sqlite3DebugPrintf X
#else
@@ -1001,6 +1000,21 @@ typedef INT16_TYPE LogEst;
#endif
/*
+** Macros for "wheretrace"
+*/
+#if !defined(SQLITE_AMAGAMATION)
+extern u32 sqlite3WhereTrace;
+#endif
+#if defined(SQLITE_DEBUG) \
+ && (defined(SQLITE_TEST) || defined(SQLITE_ENABLE_WHERETRACE))
+# define WHERETRACE(K,X) if(sqlite3WhereTrace&(K)) sqlite3DebugPrintf X
+# define WHERETRACE_ENABLED 1
+#else
+# define WHERETRACE(K,X)
+#endif
+
+
+/*
** An instance of the following structure is used to store the busy-handler
** callback for a given sqlite handle.
**
@@ -4594,7 +4608,6 @@ extern const unsigned char sqlite3UpperToLower[];
extern const unsigned char sqlite3CtypeMap[];
extern SQLITE_WSD struct Sqlite3Config sqlite3Config;
extern FuncDefHash sqlite3BuiltinFunctions;
-extern u32 sqlite3_unsupported_selecttrace;
#ifndef SQLITE_OMIT_WSD
extern int sqlite3PendingByte;
#endif