1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Fix ticket #1046 by removing code and simplifying the query optimizer.

Remarkably, this simplification also makes the optimizer do a better job.
Ticket #1051 was fixed as a side-effect. (CVS 2172)

FossilOrigin-Name: 5fd1f4711885e3dd6fb2c2700287f78bb0ea178a
This commit is contained in:
drh
2004-12-25 01:03:13 +00:00
parent 9a09a3caed
commit e6f85e71e9
10 changed files with 58 additions and 78 deletions

View File

@@ -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.93 2004/12/14 03:34:34 drh Exp $
** $Id: delete.c,v 1.94 2004/12/25 01:03:14 drh Exp $
*/
#include "sqliteInt.h"
@@ -225,11 +225,12 @@ void sqlite3DeleteFrom(
/* Begin the database scan
*/
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 1, 0, 0);
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, 0);
if( pWInfo==0 ) goto delete_from_cleanup;
/* Remember the key of every item to be deleted.
/* Remember the rowid of every item to be deleted.
*/
sqlite3VdbeAddOp(v, OP_Recno, iCur, 0);
sqlite3VdbeAddOp(v, OP_ListWrite, 0, 0);
if( db->flags & SQLITE_CountRows ){
sqlite3VdbeAddOp(v, OP_AddImm, 1, 0);