Remove the OP_SetFound opcode and its cousins. (CVS 1430)

FossilOrigin-Name: 5524075ec02102446f8d153e068546f763d4bf7a
diff --git a/src/build.c b/src/build.c
index 284c437..fc0b70a 100644
--- a/src/build.c
+++ b/src/build.c
@@ -23,7 +23,7 @@
 **     ROLLBACK
 **     PRAGMA
 **
-** $Id: build.c,v 1.191 2004/05/21 01:29:06 drh Exp $
+** $Id: build.c,v 1.192 2004/05/21 13:39:50 drh Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -2149,7 +2149,7 @@
 **
 ** This routine starts a new transaction if we are not already within
 ** a transaction.  If we are already within a transaction, then a checkpoint
-** is set if the setCheckpoint parameter is true.  A checkpoint should
+** is set if the setStatement parameter is true.  A checkpoint should
 ** be set for operations that might fail (due to a constraint) part of
 ** the way through and which will need to undo some writes without having to
 ** rollback the whole transaction.  For operations where all constraints
@@ -2161,7 +2161,7 @@
 ** iDb==1 then only the temp database is made writable.  If iDb>1 then the
 ** specified auxiliary database and the temp database are made writable.
 */
-void sqlite3BeginWriteOperation(Parse *pParse, int setCheckpoint, int iDb){
+void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
   Vdbe *v;
   sqlite *db = pParse->db;
   if( DbHasProperty(db, iDb, DB_Locked) ) return;
@@ -2172,10 +2172,10 @@
     DbSetProperty(db, iDb, DB_Locked);
     sqlite3CodeVerifySchema(pParse, iDb);
     if( iDb!=1 ){
-      sqlite3BeginWriteOperation(pParse, setCheckpoint, 1);
+      sqlite3BeginWriteOperation(pParse, setStatement, 1);
     }
-  }else if( setCheckpoint ){
-    sqlite3VdbeAddOp(v, OP_Checkpoint, iDb, 0);
+  }else if( setStatement ){
+    sqlite3VdbeAddOp(v, OP_Statement, iDb, 0);
     DbSetProperty(db, iDb, DB_Locked);
   }
 }
diff --git a/src/expr.c b/src/expr.c
index 5218b1f..c774f73 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.126 2004/05/21 02:14:25 drh Exp $
+** $Id: expr.c,v 1.127 2004/05/21 13:39:51 drh Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -1431,22 +1431,6 @@
       sqlite3VdbeAddOp(v, op, 1, dest);
       break;
     }
-#if 0
-    case TK_IN: {
-      int addr;
-      sqlite3ExprCode(pParse, pExpr->pLeft);
-      addr = sqlite3VdbeCurrentAddr(v);
-      sqlite3VdbeAddOp(v, OP_NotNull, -1, addr+3);
-      sqlite3VdbeAddOp(v, OP_Pop, 1, 0);
-      sqlite3VdbeAddOp(v, OP_Goto, 0, jumpIfNull ? dest : addr+4);
-      if( pExpr->pSelect ){
-        sqlite3VdbeAddOp(v, OP_Found, pExpr->iTable, dest);
-      }else{
-        sqlite3VdbeAddOp(v, OP_SetFound, pExpr->iTable, dest);
-      }
-      break;
-    }
-#endif
     case TK_BETWEEN: {
       int addr;
       sqlite3ExprCode(pParse, pExpr->pLeft);
diff --git a/src/vdbe.c b/src/vdbe.c
index 51f954b..b869610 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
 ** in this file for details.  If in doubt, do not deviate from existing
 ** commenting and indentation practices when changing or adding code.
 **
-** $Id: vdbe.c,v 1.314 2004/05/21 10:49:48 danielk1977 Exp $
+** $Id: vdbe.c,v 1.315 2004/05/21 13:39:51 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -2672,18 +2672,19 @@
   break;
 }
 
-/* Opcode: Checkpoint P1 * *
+/* Opcode: Statement P1 * *
 **
-** Begin a checkpoint.  A checkpoint is the beginning of a operation that
-** is part of a larger transaction but which might need to be rolled back
-** itself without effecting the containing transaction.  A checkpoint will
-** be automatically committed or rollback when the VDBE halts.
+** Begin an individual statement transaction which is part of a larger
+** BEGIN..COMMIT transaction.  This is needed so that the statement
+** can be rolled back after an error without having to roll back the
+** entire transaction.  The statement transaction will automatically
+** commit when the VDBE halts.
 **
-** The checkpoint is begun on the database file with index P1.  The main
+** The statement is begun on the database file with index P1.  The main
 ** database file has an index of 0 and the file used for temporary tables
 ** has an index of 1.
 */
-case OP_Checkpoint: {
+case OP_Statement: {
   int i = pOp->p1;
   if( i>=0 && i<db->nDb && db->aDb[i].pBt && db->aDb[i].inTrans==1 ){
     rc = sqlite3BtreeBeginStmt(db->aDb[i].pBt);
@@ -5154,86 +5155,6 @@
   break;
 }
 
-/* Opcode: SetFound P1 P2 *
-**
-** Pop the stack once and compare the value popped off with the
-** contents of set P1.  If the element popped exists in set P1,
-** then jump to P2.  Otherwise fall through.
-*/
-case OP_SetFound: {
-  int i = pOp->p1;
-  assert( pTos>=p->aStack );
-  Stringify(pTos);
-  if( i>=0 && i<p->nSet && sqlite3HashFind(&p->aSet[i].hash, pTos->z, pTos->n)){
-    pc = pOp->p2 - 1;
-  }
-  Release(pTos);
-  pTos--;
-  break;
-}
-
-/* Opcode: SetNotFound P1 P2 *
-**
-** Pop the stack once and compare the value popped off with the
-** contents of set P1.  If the element popped does not exists in 
-** set P1, then jump to P2.  Otherwise fall through.
-*/
-case OP_SetNotFound: {
-  int i = pOp->p1;
-  assert( pTos>=p->aStack );
-  Stringify(pTos);
-  if( i<0 || i>=p->nSet ||
-       sqlite3HashFind(&p->aSet[i].hash, pTos->z, pTos->n)==0 ){
-    pc = pOp->p2 - 1;
-  }
-  Release(pTos);
-  pTos--;
-  break;
-}
-
-/* Opcode: SetFirst P1 P2 *
-**
-** Read the first element from set P1 and push it onto the stack.  If the
-** set is empty, push nothing and jump immediately to P2.  This opcode is
-** used in combination with OP_SetNext to loop over all elements of a set.
-*/
-/* Opcode: SetNext P1 P2 *
-**
-** Read the next element from set P1 and push it onto the stack.  If there
-** are no more elements in the set, do not do the push and fall through.
-** Otherwise, jump to P2 after pushing the next set element.
-*/
-case OP_SetFirst: 
-case OP_SetNext: {
-  Set *pSet;
-  CHECK_FOR_INTERRUPT;
-  if( pOp->p1<0 || pOp->p1>=p->nSet ){
-    if( pOp->opcode==OP_SetFirst ) pc = pOp->p2 - 1;
-    break;
-  }
-  pSet = &p->aSet[pOp->p1];
-  if( pOp->opcode==OP_SetFirst ){
-    pSet->prev = sqliteHashFirst(&pSet->hash);
-    if( pSet->prev==0 ){
-      pc = pOp->p2 - 1;
-      break;
-    }
-  }else{
-    assert( pSet->prev );
-    pSet->prev = sqliteHashNext(pSet->prev);
-    if( pSet->prev==0 ){
-      break;
-    }else{
-      pc = pOp->p2 - 1;
-    }
-  }
-  pTos++;
-  pTos->z = sqliteHashKey(pSet->prev);
-  pTos->n = sqliteHashKeysize(pSet->prev);
-  pTos->flags = MEM_Utf8 | MEM_Str | MEM_Ephem;
-  break;
-}
-
 /* Opcode: Vacuum * * *
 **
 ** Vacuum the entire database.  This opcode will cause other virtual