diff options
author | danielk1977 <danielk1977@noemail.net> | 2009-02-24 10:14:40 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2009-02-24 10:14:40 +0000 |
commit | 2d2e7bd32e7267bd9fe9c40a0b5c97cace2bd17e (patch) | |
tree | be7e86a13b3a10703fb1d45fe1cb7eaa32da7a9d /src | |
parent | a55331620e1162c2fef1fee80f0866cc0e379f46 (diff) | |
download | sqlite-2d2e7bd32e7267bd9fe9c40a0b5c97cace2bd17e.tar.gz sqlite-2d2e7bd32e7267bd9fe9c40a0b5c97cace2bd17e.zip |
Reverse commit (6315) for now. (CVS 6317)
FossilOrigin-Name: 0e7c369c23a8767b4d3e5cdd47c14716992fb71a
Diffstat (limited to 'src')
-rw-r--r-- | src/delete.c | 3 | ||||
-rw-r--r-- | src/expr.c | 3 | ||||
-rw-r--r-- | src/resolve.c | 20 | ||||
-rw-r--r-- | src/sqliteInt.h | 3 | ||||
-rw-r--r-- | src/update.c | 3 | ||||
-rw-r--r-- | src/where.c | 17 |
6 files changed, 13 insertions, 36 deletions
diff --git a/src/delete.c b/src/delete.c index b70352c87..62449a63d 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 @@ void sqlite3DeleteFrom( /* 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 4b92d6c0f..ee3a26219 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 @@ SrcList *sqlite3SrcListDup(sqlite3 *db, SrcList *p, int flags){ 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 29f1f2b92..749e473d4 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 @@ static int lookupName( ** 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 f4ee45a50..429346d29 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 @@ struct SrcList { 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 8cfbf3a98..b377ee98c 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 @@ void sqlite3Update( /* 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 e76fc11cb..06eb5f99d 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 @@ static void bestIndex( } } - 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; |