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

Optimizer now converts OR-connected WHERE-clause terms into an IN operator so

that they can be used with indices.  There are known problems with the
ORDER BY optimization in this and in several prior check-ins.  This
check-in is not recommended for production use. (CVS 2569)

FossilOrigin-Name: d23c8bf81e508722e92ff1b9c8bc98dc026a31f2
This commit is contained in:
drh
2005-07-29 15:10:17 +00:00
parent ed37800693
commit 6c30be8e51
5 changed files with 146 additions and 29 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.213 2005/07/21 18:23:20 drh Exp $
** $Id: expr.c,v 1.214 2005/07/29 15:10:18 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1334,7 +1334,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
** this code only executes once. Because for a non-constant
** expression we need to rerun this code each time.
*/
if( testAddr>=0 && !sqlite3ExprIsConstant(pE2) ){
if( testAddr>0 && !sqlite3ExprIsConstant(pE2) ){
VdbeOp *aOp = sqlite3VdbeGetOp(v, testAddr-1);
int i;
for(i=0; i<4; i++){