aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sqliteInt.h1
-rw-r--r--src/where.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 2159ec848..5e4afb1ae 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -1789,6 +1789,7 @@ struct sqlite3 {
#define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */
#define SQLITE_FlttnUnionAll 0x00800000 /* Disable the UNION ALL flattener */
/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */
+#define SQLITE_IndexedExpr 0x01000000 /* Pull exprs from index when able */
#define SQLITE_AllOpts 0xffffffff /* All optimizations */
/*
diff --git a/src/where.c b/src/where.c
index a9285c831..8e9290c34 100644
--- a/src/where.c
+++ b/src/where.c
@@ -5986,7 +5986,7 @@ WhereInfo *sqlite3WhereBegin(
op = OP_ReopenIdx;
}else{
iIndexCur = pParse->nTab++;
- if( pIx->bHasExpr ){
+ if( pIx->bHasExpr && OptimizationEnabled(db, SQLITE_IndexedExpr) ){
whereAddIndexedExpr(pParse, pIx, iIndexCur, pTabItem);
}
}