diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 6 | ||||
-rw-r--r-- | src/main.c | 8 | ||||
-rw-r--r-- | src/select.c | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 10 | ||||
-rw-r--r-- | src/vdbeInt.h | 2 | ||||
-rw-r--r-- | src/vdbeaux.c | 6 | ||||
-rw-r--r-- | src/vdbetrace.c | 4 |
7 files changed, 21 insertions, 17 deletions
diff --git a/src/expr.c b/src/expr.c index 8e51bee2f..ede9c9d39 100644 --- a/src/expr.c +++ b/src/expr.c @@ -2949,7 +2949,7 @@ int sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr, int target){ return inReg; } -#if defined(SQLITE_DEBUG) +#if defined(SQLITE_ENABLE_TREE_EXPLAIN) /* ** Generate a human-readable explanation of an expression tree. */ @@ -3178,9 +3178,9 @@ void sqlite3ExplainExpr(Vdbe *pOut, Expr *pExpr){ sqlite3ExplainPrintf(pOut,")"); } } -#endif /* defined(SQLITE_DEBUG) */ +#endif /* defined(SQLITE_ENABLE_TREE_EXPLAIN) */ -#if defined(SQLITE_DEBUG) +#if defined(SQLITE_ENABLE_TREE_EXPLAIN) /* ** Generate a human-readable explanation of an expression list. */ diff --git a/src/main.c b/src/main.c index ca98d3140..d6dc0c79e 100644 --- a/src/main.c +++ b/src/main.c @@ -2936,12 +2936,13 @@ 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_DEBUG, each sqlite3_stmt holds a string that - ** describes the optimized parse tree. This test-control returns a - ** pointer to that string. + ** 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*); @@ -2949,6 +2950,7 @@ int sqlite3_test_control(int op, ...){ *pzRet = sqlite3VdbeExplanation((Vdbe*)pStmt); break; } +#endif } va_end(ap); diff --git a/src/select.c b/src/select.c index 15b34e2b4..c41dc07f9 100644 --- a/src/select.c +++ b/src/select.c @@ -4494,7 +4494,7 @@ select_end: return rc; } -#if defined(SQLITE_DEBUG) +#if defined(SQLITE_ENABLE_TREE_EXPLAIN) /* ** Generate a human-readable description of a the Select object. */ diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 7c57558ef..6266a9cb7 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1707,10 +1707,10 @@ struct Expr { #define EP_FixedDest 0x0200 /* Result needed in a specific register */ #define EP_IntValue 0x0400 /* Integer value contained in u.iValue */ #define EP_xIsSelect 0x0800 /* x.pSelect is valid (otherwise x.pList is) */ - -#define EP_Reduced 0x1000 /* Expr struct is EXPR_REDUCEDSIZE bytes only */ -#define EP_TokenOnly 0x2000 /* Expr struct is EXPR_TOKENONLYSIZE bytes only */ -#define EP_Static 0x4000 /* Held in memory not obtained from malloc() */ +#define EP_Hint 0x1000 /* Optimizer hint. Not required for correctness */ +#define EP_Reduced 0x2000 /* Expr struct is EXPR_REDUCEDSIZE bytes only */ +#define EP_TokenOnly 0x4000 /* Expr struct is EXPR_TOKENONLYSIZE bytes only */ +#define EP_Static 0x8000 /* Held in memory not obtained from malloc() */ /* ** The following are the meanings of bits in the Expr.flags2 field. @@ -2653,7 +2653,7 @@ char *sqlite3MAppendf(sqlite3*,char*,const char*,...); #endif /* Output formatting for SQLITE_TESTCTRL_EXPLAIN */ -#if defined(SQLITE_DEBUG) +#if defined(SQLITE_ENABLE_TREE_EXPLAIN) void sqlite3ExplainBegin(Vdbe*); void sqlite3ExplainPrintf(Vdbe*, const char*, ...); void sqlite3ExplainNL(Vdbe*); diff --git a/src/vdbeInt.h b/src/vdbeInt.h index fb49898a1..a56dedf6a 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -337,6 +337,8 @@ struct Vdbe { void *pFree; /* Free this when deleting the vdbe */ #ifdef SQLITE_DEBUG FILE *trace; /* Write an execution trace here, if not NULL */ +#endif +#ifdef SQLITE_ENABLE_TREE_EXPLAIN Explain *pExplain; /* The explainer */ char *zExplain; /* Explanation of data structures */ #endif diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 1c67902f1..747c846d0 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -2474,9 +2474,9 @@ void sqlite3VdbeDeleteObject(sqlite3 *db, Vdbe *p){ sqlite3DbFree(db, p->aColName); sqlite3DbFree(db, p->zSql); sqlite3DbFree(db, p->pFree); -#if defined(SQLITE_DEBUG) - sqlite3_free(p->zExplain); - sqlite3_free(p->pExplain); +#if defined(SQLITE_ENABLE_TREE_EXPLAIN) + sqlite3DbFree(db, p->zExplain); + sqlite3DbFree(db, p->pExplain); #endif sqlite3DbFree(db, p); } diff --git a/src/vdbetrace.c b/src/vdbetrace.c index bc05e5897..4c4be1373 100644 --- a/src/vdbetrace.c +++ b/src/vdbetrace.c @@ -13,7 +13,7 @@ ** This file contains code used to insert the values of host parameters ** (aka "wildcards") into the SQL text output by sqlite3_trace(). ** -** The Vdbe explainer is also found here. +** The Vdbe parse-tree explainer is also found here. */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -160,7 +160,7 @@ char *sqlite3VdbeExpandSql( ** for the Vdbe. */ -#if defined(SQLITE_DEBUG) +#if defined(SQLITE_ENABLE_TREE_EXPLAIN) /* ** Allocate a new Explain object |