diff options
author | drh <drh@noemail.net> | 2004-09-01 03:06:34 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2004-09-01 03:06:34 +0000 |
commit | 91bb0eedd1033769d28444df7118556d9ae12520 (patch) | |
tree | 1050272234ef8039505203fb2fa7969759941c6d /src/expr.c | |
parent | c8d7441eb4cb02f1a3fc5efebf8fdf55e4882dd9 (diff) | |
download | sqlite-91bb0eedd1033769d28444df7118556d9ae12520.tar.gz sqlite-91bb0eedd1033769d28444df7118556d9ae12520.zip |
Optimizations on the SELECT code generator. (CVS 1926)
FossilOrigin-Name: 9c411c3c8dde2061c98513a413ef58c5c2de45af
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index e8dfc2baf..91756363d 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.158 2004/08/31 13:45:12 drh Exp $ +** $Id: expr.c,v 1.159 2004/09/01 03:06:35 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -220,6 +220,20 @@ Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, Token *pToken){ } /* +** Join two expressions using an AND operator. If either expression is +** NULL, then just return the other expression. +*/ +Expr *sqlite3ExprAnd(Expr *pLeft, Expr *pRight){ + if( pLeft==0 ){ + return pRight; + }else if( pRight==0 ){ + return pLeft; + }else{ + return sqlite3Expr(TK_AND, pLeft, pRight, 0); + } +} + +/* ** Set the Expr.span field of the given expression to span all ** text between the two given tokens. */ |