mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-21 09:00:59 +03:00
Reverse commit (6315) for now. (CVS 6317)
FossilOrigin-Name: 0e7c369c23a8767b4d3e5cdd47c14716992fb71a
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
17
src/where.c
17
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;
|
||||
|
||||
Reference in New Issue
Block a user