Reverse commit (6315) for now. (CVS 6317)

FossilOrigin-Name: 0e7c369c23a8767b4d3e5cdd47c14716992fb71a
diff --git a/src/delete.c b/src/delete.c
index b70352c..62449a6 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** in order to generate code for DELETE FROM statements.
 **
-** $Id: delete.c,v 1.194 2009/02/23 17:33:50 danielk1977 Exp $
+** $Id: delete.c,v 1.195 2009/02/24 10:14:40 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -395,7 +395,6 @@
     /* Collect rowids of every row to be deleted.
     */
     sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet);
-    pTabList->a[0].usesRowid = 1;
     pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0,
                                WHERE_FILL_ROWSET, iRowSet);
     if( pWInfo==0 ) goto delete_from_cleanup;
diff --git a/src/expr.c b/src/expr.c
index 4b92d6c..ee3a262 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.415 2009/02/23 17:33:50 danielk1977 Exp $
+** $Id: expr.c,v 1.416 2009/02/24 10:14:40 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -931,7 +931,6 @@
     pNewItem->pOn = sqlite3ExprDup(db, pOldItem->pOn, flags);
     pNewItem->pUsing = sqlite3IdListDup(db, pOldItem->pUsing);
     pNewItem->colUsed = pOldItem->colUsed;
-    pNewItem->usesRowid = pOldItem->usesRowid;
   }
   return pNew;
 }
diff --git a/src/resolve.c b/src/resolve.c
index 29f1f2b..749e473 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -14,7 +14,7 @@
 ** resolve all identifiers by associating them with a particular
 ** table and column.
 **
-** $Id: resolve.c,v 1.17 2009/02/23 17:33:50 danielk1977 Exp $
+** $Id: resolve.c,v 1.18 2009/02/24 10:14:40 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <stdlib.h>
@@ -347,18 +347,14 @@
   ** column number is greater than the number of bits in the bitmask
   ** then set the high-order bit of the bitmask.
   */
-  if( pMatch ){
-    if( pExpr->iColumn>=0 ){
-      int n = pExpr->iColumn;
-      testcase( n==BMS-1 );
-      if( n>=BMS ){
-        n = BMS-1;
-      }
-      assert( pMatch->iCursor==pExpr->iTable );
-      pMatch->colUsed |= ((Bitmask)1)<<n;
-    }else{
-      pMatch->usesRowid = 1;
+  if( pExpr->iColumn>=0 && pMatch!=0 ){
+    int n = pExpr->iColumn;
+    testcase( n==BMS-1 );
+    if( n>=BMS ){
+      n = BMS-1;
     }
+    assert( pMatch->iCursor==pExpr->iTable );
+    pMatch->colUsed |= ((Bitmask)1)<<n;
   }
 
 lookupname_end:
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index f4ee45a..429346d 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.837 2009/02/24 10:01:52 danielk1977 Exp $
+** @(#) $Id: sqliteInt.h,v 1.838 2009/02/24 10:14:40 danielk1977 Exp $
 */
 #ifndef _SQLITEINT_H_
 #define _SQLITEINT_H_
@@ -1602,7 +1602,6 @@
     u8 isPopulated;   /* Temporary table associated with SELECT is populated */
     u8 jointype;      /* Type of join between this able and the previous */
     u8 notIndexed;    /* True if there is a NOT INDEXED clause */
-    u8 usesRowid;     /* True if the rowid field is read */
     int iCursor;      /* The VDBE cursor number used to access this table */
     Expr *pOn;        /* The ON clause of a join */
     IdList *pUsing;   /* The USING clause of a join */
diff --git a/src/update.c b/src/update.c
index 8cfbf3a..b377ee9 100644
--- a/src/update.c
+++ b/src/update.c
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** to handle UPDATE statements.
 **
-** $Id: update.c,v 1.194 2009/02/23 17:33:50 danielk1977 Exp $
+** $Id: update.c,v 1.195 2009/02/24 10:14:40 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -343,7 +343,6 @@
   /* Begin the database scan
   */
   sqlite3VdbeAddOp2(v, OP_Null, 0, regOldRowid);
-  pTabList->a[0].usesRowid = 1;
   pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0,
                              WHERE_ONEPASS_DESIRED, 0);
   if( pWInfo==0 ) goto update_cleanup;
diff --git a/src/where.c b/src/where.c
index e76fc11..06eb5f9 100644
--- a/src/where.c
+++ b/src/where.c
@@ -16,7 +16,7 @@
 ** so is applicable.  Because this module is responsible for selecting
 ** indices, you might also think of this module as the "query optimizer".
 **
-** $Id: where.c,v 1.372 2009/02/23 17:33:50 danielk1977 Exp $
+** $Id: where.c,v 1.373 2009/02/24 10:14:40 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 
@@ -2035,21 +2035,6 @@
     }
   }
 
-  if( pCost->plan.wsFlags==0 && pSrc->colUsed==0 && pSrc->usesRowid==0 ){
-    Index *pSmallest = 0;
-    assert( pSrc->pIndex==0 );
-    for(pProbe=pSrc->pTab->pIndex; pProbe; pProbe=pProbe->pNext){
-      if( !pSmallest || pProbe->nColumn<pSmallest->nColumn ){
-        pSmallest = pProbe;
-      }
-    }
-    if( pSmallest && pSmallest->nColumn<pSrc->pTab->nCol ){
-      assert( pCost->plan.nEq==0 );
-      pCost->plan.u.pIdx = pSmallest;
-      pCost->plan.wsFlags = WHERE_COLUMN_RANGE|WHERE_IDX_ONLY;
-    }
-  }
-
   /* Report the best result
   */
   pCost->plan.wsFlags |= eqTermMask;