1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-08 03:22:21 +03:00

Optimizations on the SELECT code generator. (CVS 1926)

FossilOrigin-Name: 9c411c3c8dde2061c98513a413ef58c5c2de45af
This commit is contained in:
drh
2004-09-01 03:06:34 +00:00
parent c8d7441eb4
commit 91bb0eedd1
5 changed files with 129 additions and 121 deletions

View File

@@ -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>
@@ -219,6 +219,20 @@ Expr *sqlite3Expr(int op, Expr *pLeft, Expr *pRight, Token *pToken){
return pNew;
}
/*
** 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.