Continuing improvements to the multi-index OR-clause optimizer.  Added a
few simple test cases. (CVS 6062)

FossilOrigin-Name: 55d4f493e7df8515574a75caec9967d6c71b6012
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 56d07f8..221813b 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.814 2008/12/23 13:35:23 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.815 2008/12/23 23:56:22 drh Exp $
 */
 #ifndef _SQLITEINT_H_
 #define _SQLITEINT_H_
@@ -1595,10 +1595,11 @@
 /*
 ** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin().
 */
-#define WHERE_ORDERBY_NORMAL     0   /* No-op */
-#define WHERE_ORDERBY_MIN        1   /* ORDER BY processing for min() func */
-#define WHERE_ORDERBY_MAX        2   /* ORDER BY processing for max() func */
-#define WHERE_ONEPASS_DESIRED    4   /* Want to do one-pass UPDATE/DELETE */
+#define WHERE_ORDERBY_NORMAL    0x000  /* No-op */
+#define WHERE_ORDERBY_MIN       0x001  /* ORDER BY processing for min() func */
+#define WHERE_ORDERBY_MAX       0x002  /* ORDER BY processing for max() func */
+#define WHERE_ONEPASS_DESIRED   0x004  /* Want to do one-pass UPDATE/DELETE */
+#define WHERE_FILL_ROWSET       0x008  /* Save results in a RowSet object */
 
 /*
 ** The WHERE clause processing routine has two halves.  The
@@ -1610,13 +1611,13 @@
 struct WhereInfo {
   Parse *pParse;       /* Parsing and code generating context */
   u8 okOnePass;        /* Ok to use one-pass algorithm for UPDATE or DELETE */
+  int regRowSet;                 /* Store rowids in this rowset if >=0 */
   SrcList *pTabList;             /* List of tables in the join */
   int iTop;                      /* The very beginning of the WHERE loop */
   int iContinue;                 /* Jump here to continue with next record */
   int iBreak;                    /* Jump here to break out of the loop */
   int nLevel;                    /* Number of nested loop */
   struct WhereClause *pWC;       /* Decomposition of the WHERE clause */
-  sqlite3_index_info **apInfo;   /* Array of pointers to index info objects */
   WhereLevel a[1];               /* Information about each nest loop in WHERE */
 };
 
@@ -2260,7 +2261,7 @@
 #endif
 void sqlite3DeleteFrom(Parse*, SrcList*, Expr*);
 void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int);
-WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**, u8);
+WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**, u8, int);
 void sqlite3WhereEnd(WhereInfo*);
 int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int, int);
 void sqlite3ExprCodeMove(Parse*, int, int, int);