1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Enable SELECT query planning tracing when compiled with

SQLITE_ENABLE_SELECTTRACE and either SQLITE_DEBUG or SQLITE_TEST.

FossilOrigin-Name: cbe0cf9ddf46f0a678c85d49bfa74e3b7712e1a1
This commit is contained in:
drh
2014-09-20 18:18:33 +00:00
parent af6f25aacc
commit abd4c72357
6 changed files with 74 additions and 12 deletions

View File

@@ -14,6 +14,17 @@
*/
#include "sqliteInt.h"
/*
** Trace output macros
*/
#if SELECTTRACE_ENABLED
/***/ int sqlite3SelectTrace = 0;
# define SELECTTRACE(K,X) if(sqlite3SelectTrace&(K)) sqlite3DebugPrintf X
#else
# define SELECTTRACE(K,X)
#endif
/*
** An instance of the following object is used to record information about
** how to process the DISTINCT keyword, to simplify passing that information
@@ -3355,6 +3366,8 @@ static int flattenSubquery(
}
/***** If we reach this point, flattening is permitted. *****/
SELECTTRACE(1, ("flatten %s (term %d) into %s\n",
pSub->zSelLabel, iFrom, p->zSelLabel));
/* Authorize the subquery */
pParse->zAuthContext = pSubitem->zName;