diff options
author | drh <drh@noemail.net> | 2013-01-17 16:43:33 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-01-17 16:43:33 +0000 |
commit | eb5bc9261cd47a5883fba0620775d6f96be43c25 (patch) | |
tree | 92bf7b133532c3776e5e6dd6bcffcd6af016b4a8 /src | |
parent | 63db0392ae67c0e2d7c188bf8fb6f47e43731663 (diff) | |
download | sqlite-eb5bc9261cd47a5883fba0620775d6f96be43c25.tar.gz sqlite-eb5bc9261cd47a5883fba0620775d6f96be43c25.zip |
Add the ability to disable transitive constraints using the
sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) interface.
FossilOrigin-Name: 593d67c8b0908daf7a70b2a310ed85515d384cbf
Diffstat (limited to 'src')
-rw-r--r-- | src/sqliteInt.h | 1 | ||||
-rw-r--r-- | src/where.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d5cb69732..a98eb4b3d 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -978,6 +978,7 @@ struct sqlite3 { #define SQLITE_CoverIdxScan 0x0040 /* Covering index scans */ #define SQLITE_OrderByIdxJoin 0x0080 /* ORDER BY of joins via index */ #define SQLITE_SubqCoroutine 0x0100 /* Evaluate subqueries as coroutines */ +#define SQLITE_Transitive 0x0200 /* Transitive constraints */ #define SQLITE_AllOpts 0xffff /* All optimizations */ /* diff --git a/src/where.c b/src/where.c index 46268bf0f..f97bf019c 100644 --- a/src/where.c +++ b/src/where.c @@ -1295,7 +1295,10 @@ static void exprAnalyze( pTerm = &pWC->a[idxTerm]; pTerm->nChild = 1; pTerm->wtFlags |= TERM_COPIED; - if( pExpr->op==TK_EQ && !ExprHasProperty(pExpr, EP_FromJoin) ){ + if( pExpr->op==TK_EQ + && !ExprHasProperty(pExpr, EP_FromJoin) + && OptimizationEnabled(db, SQLITE_Transitive) + ){ pTerm->eOperator |= WO_EQUIV; eExtraOp = WO_EQUIV; } |