]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
removed unused functions from test3.c (test code only); (CVS 6867)
authorshane <shane@noemail.net>
Thu, 9 Jul 2009 02:48:23 +0000 (02:48 +0000)
committershane <shane@noemail.net>
Thu, 9 Jul 2009 02:48:23 +0000 (02:48 +0000)
FossilOrigin-Name: 0eb69e8dda13e2d52a06f66a71480f59fd766271

manifest
manifest.uuid
src/btree.c
src/test3.c
src/test_btree.c
test/speed3.test

index 49fab3e4163a3276e491078873dfbce9973519d0..a1b427a1d0058cb14c41068bf45f3fe2ea6d74fe 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Simplifications\sand\sadditional\stestcase()\smacros\sfor\sbtree.c.\s(CVS\s6866)
-D 2009-07-09T02:24:35
+C removed\sunused\sfunctions\sfrom\stest3.c\s(test\scode\sonly);\s(CVS\s6867)
+D 2009-07-09T02:48:24
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -106,7 +106,7 @@ F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025
 F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
 F src/bitvec.c 0ef0651714728055d43de7a4cdd95e703fac0119
 F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
-F src/btree.c 3a97e228379449fcba6a18e88e425bcf433b1fe5
+F src/btree.c c9775946b5f4d974e6271621d7cc620d2c42027a
 F src/btree.h e761619e76a1125d2d82bd3613b5a7ac7d1ee6f7
 F src/btreeInt.h b31e5ac04181c7e2892c33ab06228c551df6233c
 F src/build.c 867028ee9f63f7bc8eb8d4a720bb98cf9b9a12b4
@@ -170,7 +170,7 @@ F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
 F src/tclsqlite.c e18e5013dc6bca9f25e6022fbe17ba3ccb821f95
 F src/test1.c c8f9358879876660b721369f576bf6e4ac5b9210
 F src/test2.c d73e4a490349245fb196b990b80684513e0ceaee
-F src/test3.c ec1592b2660c0e0a353659fe3f7538fbbbce50ec
+F src/test3.c 30db0ba4952e90f6a2df898ae76194f038baa35d
 F src/test4.c f79ab52d27ff49b784b631a42e2ccd52cfd5c84c
 F src/test5.c 162a1cea2105a2c460a3f39fa6919617b562a288
 F src/test6.c 1a0a7a1f179469044b065b4a88aab9faee114101
@@ -180,7 +180,7 @@ F src/test9.c 963d380922f25c1c323712d05db01b19197ee6f7
 F src/test_async.c 731d23f953ece5bf40ce87810cfb7607218953c5
 F src/test_autoext.c f53b0cdf7bf5f08100009572a5d65cdb540bd0ad
 F src/test_backup.c 1384a18985a5a2d275c2662e48473bf1542ebd08
-F src/test_btree.c d7b8716544611c323860370ee364e897c861f1b0
+F src/test_btree.c 5adbba9b138988a3cf4d3b5424dbc7c85651da02
 F src/test_config.c 63d1b08809ca182ee75429573111b44735861c64
 F src/test_devsym.c 9f4bc2551e267ce7aeda195f3897d0f30c5228f4
 F src/test_func.c b8140bc4ed0d290d5e22972eb2a3bfd40aa798dc
@@ -553,7 +553,7 @@ F test/speed1.test f2974a91d79f58507ada01864c0e323093065452
 F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb
 F test/speed1p.test c4a469f29f135f4d76c55b1f2a52f36e209466cc
 F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded
-F test/speed3.test e312d7e442a5047d730569fdae2ba99bc94e1a13
+F test/speed3.test 5a419039e9da95d906adb2298af2849600c81c11
 F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
 F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
 F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 890dbab28c3a1af4a1e01221318c9200574139e7
-R ecc6dc57b5c33bedd235ae3d99ecd320
-U drh
-Z 320c447326253cde8031c4d1800cda60
+P 1b8c3a8246a5d8b8f5607014f68483735a403249
+R ccb8347dc72fa638b9b09275bc5d246a
+U shane
+Z 91fc93570d27b2dc2dec0d52c39bbb91
index 0e293ef54fa2d1b2f7865762bb6885a1d3a3ef13..c31857b7e4c0aafc49f92fff7af8e4cf691507ca 100644 (file)
@@ -1 +1 @@
-1b8c3a8246a5d8b8f5607014f68483735a403249
\ No newline at end of file
+0eb69e8dda13e2d52a06f66a71480f59fd766271
\ No newline at end of file
index 3439c195bd29ab95ac2a7eb5e6c6047e224f8312..22fbaba16d7019d707fa10dac6f9af0ac560c80a 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.666 2009/07/09 02:24:35 drh Exp $
+** $Id: btree.c,v 1.667 2009/07/09 02:48:24 shane Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -3381,39 +3381,6 @@ int sqlite3BtreeCloseCursor(BtCursor *pCur){
   return SQLITE_OK;
 }
 
-#ifdef SQLITE_TEST
-/*
-** Make a temporary cursor by filling in the fields of pTempCur.
-** The temporary cursor is not on the cursor list for the Btree.
-*/
-void sqlite3BtreeGetTempCursor(BtCursor *pCur, BtCursor *pTempCur){
-  int i;
-  assert( cursorHoldsMutex(pCur) );
-  memcpy(pTempCur, pCur, sizeof(BtCursor));
-  pTempCur->pNext = 0;
-  pTempCur->pPrev = 0;
-  for(i=0; i<=pTempCur->iPage; i++){
-    sqlite3PagerRef(pTempCur->apPage[i]->pDbPage);
-  }
-  assert( pTempCur->pKey==0 );
-}
-#endif /* SQLITE_TEST */
-
-#ifdef SQLITE_TEST
-/*
-** Delete a temporary cursor such as was made by the CreateTemporaryCursor()
-** function above.
-*/
-void sqlite3BtreeReleaseTempCursor(BtCursor *pCur){
-  int i;
-  assert( cursorHoldsMutex(pCur) );
-  for(i=0; i<=pCur->iPage; i++){
-    sqlite3PagerUnref(pCur->apPage[i]->pDbPage);
-  }
-  sqlite3_free(pCur->pKey);
-}
-#endif /* SQLITE_TEST */
-
 /*
 ** Make sure the BtCursor* given in the argument has a valid
 ** BtCursor.info structure.  If it is not already valid, call
index f30b24dfc6a40332682904e6e32c008ce2b97140..e22a0151d078a84408f173e060a8c84e637a461a 100644 (file)
@@ -13,7 +13,7 @@
 ** is not included in the SQLite library.  It is used for automated
 ** testing of the SQLite library.
 **
-** $Id: test3.c,v 1.108 2009/07/06 18:56:13 danielk1977 Exp $
+** $Id: test3.c,v 1.109 2009/07/09 02:48:24 shane Exp $
 */
 #include "sqliteInt.h"
 #include "btreeInt.h"
@@ -157,320 +157,6 @@ static int btree_begin_transaction(
   return TCL_OK;
 }
 
-/*
-** Usage:   btree_rollback ID
-**
-** Rollback changes
-*/
-static int btree_rollback(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc;
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeRollback(pBt);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_commit ID
-**
-** Commit all changes
-*/
-static int btree_commit(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc;
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeCommit(pBt);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_begin_statement ID
-**
-** Start a new statement transaction
-*/
-static int btree_begin_statement(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc;
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeBeginStmt(pBt, 1);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_rollback_statement ID
-**
-** Rollback changes
-*/
-static int btree_rollback_statement(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc;
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeSavepoint(pBt, SAVEPOINT_ROLLBACK, 0);
-  if( rc==SQLITE_OK ){
-    rc = sqlite3BtreeSavepoint(pBt, SAVEPOINT_RELEASE, 0);
-  }
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_commit_statement ID
-**
-** Commit all changes
-*/
-static int btree_commit_statement(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc;
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeSavepoint(pBt, SAVEPOINT_RELEASE, 0);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_create_table ID FLAGS
-**
-** Create a new table in the database
-*/
-static int btree_create_table(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc, iTable, flags;
-  char zBuf[30];
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID FLAGS\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  if( Tcl_GetInt(interp, argv[2], &flags) ) return TCL_ERROR;
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeCreateTable(pBt, &iTable, flags);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", iTable);
-  Tcl_AppendResult(interp, zBuf, 0);
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_drop_table ID TABLENUM
-**
-** Delete an entire table from the database
-*/
-static int btree_drop_table(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int iTable;
-  int rc;
-  int notUsed1;
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID TABLENUM\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeDropTable(pBt, iTable, &notUsed1);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_clear_table ID TABLENUM
-**
-** Remove all entries from the given table but keep the table around.
-*/
-static int btree_clear_table(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int iTable;
-  int rc;
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID TABLENUM\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeClearTable(pBt, iTable, 0);
-  sqlite3BtreeLeave(pBt);
-  if( rc!=SQLITE_OK ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_get_meta ID
-**
-** Return meta data
-*/
-static int btree_get_meta(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int i;
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  for(i=0; i<SQLITE_N_BTREE_META; i++){
-    char zBuf[30];
-    u32 v;
-    sqlite3BtreeEnter(pBt);
-    sqlite3BtreeGetMeta(pBt, i, &v);
-    sqlite3BtreeLeave(pBt);
-    sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",v);
-    Tcl_AppendElement(interp, zBuf);
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_update_meta ID METADATA...
-**
-** Return meta data
-*/
-static int btree_update_meta(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int rc;
-  int i;
-  int aMeta[SQLITE_N_BTREE_META];
-
-  if( argc!=2+SQLITE_N_BTREE_META ){
-    char zBuf[30];
-    sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",SQLITE_N_BTREE_META);
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID METADATA...\" (METADATA is ", zBuf, " integers)", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  for(i=1; i<SQLITE_N_BTREE_META; i++){
-    if( Tcl_GetInt(interp, argv[i+2], &aMeta[i]) ) return TCL_ERROR;
-  }
-  for(i=1; i<SQLITE_N_BTREE_META; i++){
-    sqlite3BtreeEnter(pBt);
-    rc = sqlite3BtreeUpdateMeta(pBt, i, aMeta[i]);
-    sqlite3BtreeLeave(pBt);
-    if( rc!=SQLITE_OK ){
-      Tcl_AppendResult(interp, errorName(rc), 0);
-      return TCL_ERROR;
-    }
-  }
-  return TCL_OK;
-}
-
 /*
 ** Usage:   btree_pager_stats ID
 **
@@ -521,77 +207,6 @@ static int btree_pager_stats(
   return TCL_OK;
 }
 
-/*
-** Usage:   btree_integrity_check ID ROOT ...
-**
-** Look through every page of the given BTree file to verify correct
-** formatting and linkage.  Return a line of text for each problem found.
-** Return an empty string if everything worked.
-*/
-static int btree_integrity_check(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  int nRoot;
-  int *aRoot;
-  int i;
-  int nErr;
-  char *zResult;
-
-  if( argc<3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID ROOT ...\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  nRoot = argc-2;
-  aRoot = (int*)sqlite3_malloc( sizeof(int)*(argc-2) );
-  for(i=0; i<argc-2; i++){
-    if( Tcl_GetInt(interp, argv[i+2], &aRoot[i]) ) return TCL_ERROR;
-  }
-#ifndef SQLITE_OMIT_INTEGRITY_CHECK
-  sqlite3BtreeEnter(pBt);
-  zResult = sqlite3BtreeIntegrityCheck(pBt, aRoot, nRoot, 10000, &nErr);
-  sqlite3BtreeLeave(pBt);
-#else
-  zResult = 0;
-#endif
-  sqlite3_free((void*)aRoot);
-  if( zResult ){
-    Tcl_AppendResult(interp, zResult, 0);
-    sqlite3_free(zResult); 
-  }
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_cursor_list ID
-**
-** Print information about all cursors to standard output for debugging.
-*/
-static int btree_cursor_list(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pBt);
-  sqlite3BtreeCursorList(pBt);
-  sqlite3BtreeLeave(pBt);
-  return SQLITE_OK;
-}
-
 /*
 ** Usage:   btree_cursor ID TABLENUM WRITEABLE
 **
@@ -622,237 +237,34 @@ static int btree_cursor(
   memset(pCur, 0, sqlite3BtreeCursorSize());
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeLockTable(pBt, iTable, wrFlag);
-  if( rc==SQLITE_OK ){
-    rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, pCur);
-  }
-  sqlite3BtreeLeave(pBt);
-  if( rc ){
-    ckfree((char *)pCur);
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pCur);
-  Tcl_AppendResult(interp, zBuf, 0);
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_close_cursor ID
-**
-** Close a cursor opened using btree_cursor.
-*/
-static int btree_close_cursor(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  Btree *pBt;
-  int rc;
-
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  pBt = pCur->pBtree;
-  sqlite3BtreeEnter(pBt);
-  rc = sqlite3BtreeCloseCursor(pCur);
-  sqlite3BtreeLeave(pBt);
-  ckfree((char *)pCur);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_move_to ID KEY
-**
-** Move the cursor to the entry with the given key.
-*/
-static int btree_move_to(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int rc;
-  int res;
-  char zBuf[20];
-
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID KEY\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
-    int iKey;
-    if( Tcl_GetInt(interp, argv[2], &iKey) ){
-      sqlite3BtreeLeave(pCur->pBtree);
-      return TCL_ERROR;
-    }
-    rc = sqlite3BtreeMovetoUnpacked(pCur, 0, iKey, 0, &res);
-  }else{
-#if 0
-    rc = sqlite3BtreeMoveto(pCur, argv[2], strlen(argv[2]), 0, &res);  
-#endif
-  }
-  sqlite3BtreeLeave(pCur->pBtree);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  if( res<0 ) res = -1;
-  if( res>0 ) res = 1;
-  sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",res);
-  Tcl_AppendResult(interp, zBuf, 0);
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_delete ID
-**
-** Delete the entry that the cursor is pointing to
-*/
-static int btree_delete(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int rc;
-
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  rc = sqlite3BtreeDelete(pCur);
-  sqlite3BtreeLeave(pCur->pBtree);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_insert ID KEY DATA ?NZERO?
-**
-** Create a new entry with the given key and data.  If an entry already
-** exists with the same key the old entry is overwritten.
-*/
-static int btree_insert(
-  void * clientData,
-  Tcl_Interp *interp,
-  int objc,
-  Tcl_Obj *CONST objv[]
-){
-  BtCursor *pCur;
-  int rc;
-  int nZero;
-
-  if( objc!=4 && objc!=5 ){
-    Tcl_WrongNumArgs(interp, 1, objv, "ID KEY DATA ?NZERO?");
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(Tcl_GetString(objv[1]));
-  if( objc==5 ){
-    if( Tcl_GetIntFromObj(interp, objv[4], &nZero) ) return TCL_ERROR;
-  }else{
-    nZero = 0;
-  }
-  sqlite3BtreeEnter(pCur->pBtree);
-  if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
-    i64 iKey;
-    int len;
-    unsigned char *pBuf;
-    if( Tcl_GetWideIntFromObj(interp, objv[2], &iKey) ){
-      sqlite3BtreeLeave(pCur->pBtree);
-      return TCL_ERROR;
-    }
-    pBuf = Tcl_GetByteArrayFromObj(objv[3], &len);
-    rc = sqlite3BtreeInsert(pCur, 0, iKey, pBuf, len, nZero, 0, 0);
-  }else{
-    int keylen;
-    int dlen;
-    unsigned char *pKBuf;
-    unsigned char *pDBuf;
-    pKBuf = Tcl_GetByteArrayFromObj(objv[2], &keylen);
-    pDBuf = Tcl_GetByteArrayFromObj(objv[3], &dlen);
-    rc = sqlite3BtreeInsert(pCur, pKBuf, keylen, pDBuf, dlen, nZero, 0, 0);
-  }
-  sqlite3BtreeLeave(pCur->pBtree);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    return TCL_ERROR;
-  }
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_next ID
-**
-** Move the cursor to the next entry in the table.  Return 0 on success
-** or 1 if the cursor was already on the last entry in the table or if
-** the table is empty.
-*/
-static int btree_next(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int rc;
-  int res = 0;
-  char zBuf[100];
-
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  rc = sqlite3BtreeNext(pCur, &res);
-  sqlite3BtreeLeave(pCur->pBtree);
+  if( rc==SQLITE_OK ){
+    rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, pCur);
+  }
+  sqlite3BtreeLeave(pBt);
   if( rc ){
+    ckfree((char *)pCur);
     Tcl_AppendResult(interp, errorName(rc), 0);
     return TCL_ERROR;
   }
-  sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res);
+  sqlite3_snprintf(sizeof(zBuf), zBuf,"%p", pCur);
   Tcl_AppendResult(interp, zBuf, 0);
   return SQLITE_OK;
 }
 
 /*
-** Usage:   btree_prev ID
+** Usage:   btree_close_cursor ID
 **
-** Move the cursor to the previous entry in the table.  Return 0 on
-** success and 1 if the cursor was already on the first entry in
-** the table or if the table was empty.
+** Close a cursor opened using btree_cursor.
 */
-static int btree_prev(
+static int btree_close_cursor(
   void *NotUsed,
   Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
   int argc,              /* Number of arguments */
   const char **argv      /* Text of each argument */
 ){
   BtCursor *pCur;
+  Btree *pBt;
   int rc;
-  int res = 0;
-  char zBuf[100];
 
   if( argc!=2 ){
     Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
@@ -860,25 +272,26 @@ static int btree_prev(
     return TCL_ERROR;
   }
   pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  rc = sqlite3BtreePrevious(pCur, &res);
-  sqlite3BtreeLeave(pCur->pBtree);
+  pBt = pCur->pBtree;
+  sqlite3BtreeEnter(pBt);
+  rc = sqlite3BtreeCloseCursor(pCur);
+  sqlite3BtreeLeave(pBt);
+  ckfree((char *)pCur);
   if( rc ){
     Tcl_AppendResult(interp, errorName(rc), 0);
     return TCL_ERROR;
   }
-  sqlite3_snprintf(sizeof(zBuf),zBuf,"%d",res);
-  Tcl_AppendResult(interp, zBuf, 0);
   return SQLITE_OK;
 }
 
 /*
-** Usage:   btree_first ID
+** Usage:   btree_next ID
 **
-** Move the cursor to the first entry in the table.  Return 0 if the
-** cursor was left point to something and 1 if the table is empty.
+** Move the cursor to the next entry in the table.  Return 0 on success
+** or 1 if the cursor was already on the last entry in the table or if
+** the table is empty.
 */
-static int btree_first(
+static int btree_next(
   void *NotUsed,
   Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
   int argc,              /* Number of arguments */
@@ -896,7 +309,7 @@ static int btree_first(
   }
   pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
-  rc = sqlite3BtreeFirst(pCur, &res);
+  rc = sqlite3BtreeNext(pCur, &res);
   sqlite3BtreeLeave(pCur->pBtree);
   if( rc ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -908,12 +321,12 @@ static int btree_first(
 }
 
 /*
-** Usage:   btree_last ID
+** Usage:   btree_first ID
 **
-** Move the cursor to the last entry in the table.  Return 0 if the
+** Move the cursor to the first entry in the table.  Return 0 if the
 ** cursor was left point to something and 1 if the table is empty.
 */
-static int btree_last(
+static int btree_first(
   void *NotUsed,
   Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
   int argc,              /* Number of arguments */
@@ -931,7 +344,7 @@ static int btree_last(
   }
   pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
-  rc = sqlite3BtreeLast(pCur, &res);
+  rc = sqlite3BtreeFirst(pCur, &res);
   sqlite3BtreeLeave(pCur->pBtree);
   if( rc ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -972,202 +385,6 @@ static int btree_eof(
   return SQLITE_OK;
 }
 
-/*
-** Usage:   btree_keysize ID
-**
-** Return the number of bytes of key.  For an INTKEY table, this
-** returns the key itself.
-*/
-static int btree_keysize(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  u64 n;
-  char zBuf[50];
-
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  sqlite3BtreeKeySize(pCur, (i64*)&n);
-  sqlite3BtreeLeave(pCur->pBtree);
-  sqlite3_snprintf(sizeof(zBuf),zBuf, "%llu", n);
-  Tcl_AppendResult(interp, zBuf, 0);
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_key ID
-**
-** Return the key for the entry at which the cursor is pointing.
-*/
-static int btree_key(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int rc;
-  u64 n;
-  char *zBuf;
-
-  if( argc!=2 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  sqlite3BtreeKeySize(pCur, (i64*)&n);
-  if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
-    char zBuf2[60];
-    sqlite3_snprintf(sizeof(zBuf2),zBuf2, "%llu", n);
-    Tcl_AppendResult(interp, zBuf2, 0);
-  }else{
-    zBuf = sqlite3_malloc( n+1 );
-    rc = sqlite3BtreeKey(pCur, 0, n, zBuf);
-    if( rc ){
-      sqlite3BtreeLeave(pCur->pBtree);
-      Tcl_AppendResult(interp, errorName(rc), 0);
-      return TCL_ERROR;
-    }
-    zBuf[n] = 0;
-    Tcl_AppendResult(interp, zBuf, 0);
-    sqlite3_free(zBuf);
-  }
-  sqlite3BtreeLeave(pCur->pBtree);
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_data ID ?N?
-**
-** Return the data for the entry at which the cursor is pointing.
-*/
-static int btree_data(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int rc;
-  u32 n;
-  char *zBuf;
-
-  if( argc!=2 && argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  sqlite3BtreeEnter(pCur->pBtree);
-  if( argc==2 ){
-    sqlite3BtreeDataSize(pCur, &n);
-  }else{
-    n = atoi(argv[2]);
-  }
-  zBuf = sqlite3_malloc( n+1 );
-  rc = sqlite3BtreeData(pCur, 0, n, zBuf);
-  sqlite3BtreeLeave(pCur->pBtree);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    sqlite3_free(zBuf);
-    return TCL_ERROR;
-  }
-  zBuf[n] = 0;
-  Tcl_AppendResult(interp, zBuf, 0);
-  sqlite3_free(zBuf);
-  return SQLITE_OK;
-}
-
-/*
-** Usage:   btree_fetch_key ID AMT
-**
-** Use the sqlite3BtreeKeyFetch() routine to get AMT bytes of the key.
-** If sqlite3BtreeKeyFetch() fails, return an empty string.
-*/
-static int btree_fetch_key(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int n;
-  int amt;
-  u64 nKey;
-  const char *zBuf;
-  char zStatic[1000];
-
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID AMT\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
-  sqlite3BtreeEnter(pCur->pBtree);
-  sqlite3BtreeKeySize(pCur, (i64*)&nKey);
-  zBuf = sqlite3BtreeKeyFetch(pCur, &amt);
-  if( zBuf && amt>=n ){
-    assert( nKey<sizeof(zStatic) );
-    if( n>0 ) nKey = n;
-    memcpy(zStatic, zBuf, (int)nKey); 
-    zStatic[nKey] = 0;
-    Tcl_AppendResult(interp, zStatic, 0);
-  }
-  sqlite3BtreeLeave(pCur->pBtree);
-  return TCL_OK;
-}
-
-/*
-** Usage:   btree_fetch_data ID AMT
-**
-** Use the sqlite3BtreeDataFetch() routine to get AMT bytes of the key.
-** If sqlite3BtreeDataFetch() fails, return an empty string.
-*/
-static int btree_fetch_data(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int n;
-  int amt;
-  u32 nData;
-  const char *zBuf;
-  char zStatic[1000];
-
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID AMT\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
-  sqlite3BtreeEnter(pCur->pBtree);
-  sqlite3BtreeDataSize(pCur, &nData);
-  zBuf = sqlite3BtreeDataFetch(pCur, &amt);
-  if( zBuf && amt>=n ){
-    assert( nData<sizeof(zStatic) );
-    if( n>0 ) nData = n;
-    memcpy(zStatic, zBuf, (int)nData); 
-    zStatic[nData] = 0;
-    Tcl_AppendResult(interp, zStatic, 0);
-  }
-  sqlite3BtreeLeave(pCur->pBtree);
-  return TCL_OK;
-}
-
 /*
 ** Usage:   btree_payload_size ID
 **
@@ -1203,159 +420,6 @@ static int btree_payload_size(
   return SQLITE_OK;
 }
 
-/*
-** Usage:   btree_cursor_info ID ?UP-CNT?
-**
-** Return integers containing information about the entry the
-** cursor is pointing to:
-**
-**   aResult[0] =  The page number
-**   aResult[1] =  The entry number
-**   aResult[2] =  Total number of entries on this page
-**   aResult[3] =  Cell size (local payload + header)
-**   aResult[4] =  Number of free bytes on this page
-**   aResult[5] =  Number of free blocks on the page
-**   aResult[6] =  Total payload size (local + overflow)
-**   aResult[7] =  Header size in bytes
-**   aResult[8] =  Local payload size
-**   aResult[9] =  Parent page number
-**   aResult[10]=  Page number of the first overflow page
-*/
-static int btree_cursor_info(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  BtCursor *pCur;
-  int rc;
-  int i, j;
-  int up;
-  int aResult[11];
-  char zBuf[400];
-
-  if( argc!=2 && argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " ID ?UP-CNT?\"", 0);
-    return TCL_ERROR;
-  }
-  pCur = sqlite3TestTextToPtr(argv[1]);
-  if( argc==3 ){
-    if( Tcl_GetInt(interp, argv[2], &up) ) return TCL_ERROR;
-  }else{
-    up = 0;
-  }
-  sqlite3BtreeEnter(pCur->pBtree);
-  rc = sqlite3BtreeCursorInfo(pCur, aResult, up);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    sqlite3BtreeLeave(pCur->pBtree);
-    return TCL_ERROR;
-  }
-  j = 0;
-  for(i=0; i<sizeof(aResult)/sizeof(aResult[0]); i++){
-    sqlite3_snprintf(40,&zBuf[j]," %d", aResult[i]);
-    j += strlen(&zBuf[j]);
-  }
-  sqlite3BtreeLeave(pCur->pBtree);
-  Tcl_AppendResult(interp, &zBuf[1], 0);
-  return SQLITE_OK;
-}
-
-/*
-** Copied from btree.c:
-*/
-static u32 t4Get4byte(unsigned char *p){
-  return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
-}
-
-/*
-**   btree_ovfl_info  BTREE  CURSOR
-**
-** Given a cursor, return the sequence of pages number that form the
-** overflow pages for the data of the entry that the cursor is point
-** to.
-*/ 
-static int btree_ovfl_info(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  Btree *pBt;
-  BtCursor *pCur;
-  Pager *pPager;
-  int rc;
-  int n;
-  int dataSize;
-  u32 pgno;
-  void *pPage;
-  int aResult[11];
-  char zElem[100];
-  Tcl_DString str;
-
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 
-                    " BTREE CURSOR", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  pCur = sqlite3TestTextToPtr(argv[2]);
-  if( (*(void**)pCur) != (void*)pBt ){
-    Tcl_AppendResult(interp, "Cursor ", argv[2], " does not belong to btree ",
-       argv[1], 0);
-    return TCL_ERROR;
-  }
-  sqlite3BtreeEnter(pBt);
-  pPager = sqlite3BtreePager(pBt);
-  rc = sqlite3BtreeCursorInfo(pCur, aResult, 0);
-  if( rc ){
-    Tcl_AppendResult(interp, errorName(rc), 0);
-    sqlite3BtreeLeave(pBt);
-    return TCL_ERROR;
-  }
-  dataSize = pBt->pBt->usableSize;
-  Tcl_DStringInit(&str);
-  n = aResult[6] - aResult[8];
-  n = (n + dataSize - 1)/dataSize;
-  pgno = (u32)aResult[10];
-  while( pgno && n-- ){
-    DbPage *pDbPage;
-    sprintf(zElem, "%d", pgno);
-    Tcl_DStringAppendElement(&str, zElem);
-    if( sqlite3PagerGet(pPager, pgno, &pDbPage)!=SQLITE_OK ){
-      Tcl_DStringFree(&str);
-      Tcl_AppendResult(interp, "unable to get page ", zElem, 0);
-      sqlite3BtreeLeave(pBt);
-      return TCL_ERROR;
-    }
-    pPage = sqlite3PagerGetData(pDbPage);
-    pgno = t4Get4byte((unsigned char*)pPage);
-    sqlite3PagerUnref(pDbPage);
-  }
-  sqlite3BtreeLeave(pBt);
-  Tcl_DStringResult(interp, &str);
-  return SQLITE_OK;
-}
-
-/*
-** The command is provided for the purpose of setting breakpoints.
-** in regression test scripts.
-**
-** By setting a GDB breakpoint on this procedure and executing the
-** btree_breakpoint command in a test script, we can stop GDB at
-** the point in the script where the btree_breakpoint command is
-** inserted.  This is useful for debugging.
-*/
-static int btree_breakpoint(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  return TCL_OK;
-}
-
 /*
 ** usage:   varint_test  START  MULTIPLIER  COUNT  INCREMENT
 **
@@ -1484,38 +548,6 @@ static int btree_from_db(
   return TCL_OK;
 }
 
-
-/*
-** usage:   btree_set_cache_size ID NCACHE
-**
-** Set the size of the cache used by btree $ID.
-*/
-static int btree_set_cache_size(
-  void *NotUsed,
-  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */
-  int argc,              /* Number of arguments */
-  const char **argv      /* Text of each argument */
-){
-  int nCache;
-  Btree *pBt;
-
-  if( argc!=3 ){
-    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
-       " BT NCACHE\"", 0);
-    return TCL_ERROR;
-  }
-  pBt = sqlite3TestTextToPtr(argv[1]);
-  if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
-
-  sqlite3_mutex_enter(pBt->db->mutex);
-  sqlite3BtreeEnter(pBt);
-  sqlite3BtreeSetCacheSize(pBt, nCache);
-  sqlite3BtreeLeave(pBt);
-  sqlite3_mutex_leave(pBt->db->mutex);
-
-  return TCL_OK;
-}
-
 /*
 ** Usage:   btree_ismemdb ID
 **
@@ -1557,41 +589,16 @@ int Sqlitetest3_Init(Tcl_Interp *interp){
      { "btree_open",               (Tcl_CmdProc*)btree_open               },
      { "btree_close",              (Tcl_CmdProc*)btree_close              },
      { "btree_begin_transaction",  (Tcl_CmdProc*)btree_begin_transaction  },
-     { "btree_commit",             (Tcl_CmdProc*)btree_commit             },
-     { "btree_rollback",           (Tcl_CmdProc*)btree_rollback           },
-     { "btree_create_table",       (Tcl_CmdProc*)btree_create_table       },
-     { "btree_drop_table",         (Tcl_CmdProc*)btree_drop_table         },
-     { "btree_clear_table",        (Tcl_CmdProc*)btree_clear_table        },
-     { "btree_get_meta",           (Tcl_CmdProc*)btree_get_meta           },
-     { "btree_update_meta",        (Tcl_CmdProc*)btree_update_meta        },
      { "btree_pager_stats",        (Tcl_CmdProc*)btree_pager_stats        },
      { "btree_cursor",             (Tcl_CmdProc*)btree_cursor             },
      { "btree_close_cursor",       (Tcl_CmdProc*)btree_close_cursor       },
-     { "btree_move_to",            (Tcl_CmdProc*)btree_move_to            },
-     { "btree_delete",             (Tcl_CmdProc*)btree_delete             },
      { "btree_next",               (Tcl_CmdProc*)btree_next               },
-     { "btree_prev",               (Tcl_CmdProc*)btree_prev               },
      { "btree_eof",                (Tcl_CmdProc*)btree_eof                },
-     { "btree_keysize",            (Tcl_CmdProc*)btree_keysize            },
-     { "btree_key",                (Tcl_CmdProc*)btree_key                },
-     { "btree_data",               (Tcl_CmdProc*)btree_data               },
-     { "btree_fetch_key",          (Tcl_CmdProc*)btree_fetch_key          },
-     { "btree_fetch_data",         (Tcl_CmdProc*)btree_fetch_data         },
      { "btree_payload_size",       (Tcl_CmdProc*)btree_payload_size       },
      { "btree_first",              (Tcl_CmdProc*)btree_first              },
-     { "btree_last",               (Tcl_CmdProc*)btree_last               },
-     { "btree_integrity_check",    (Tcl_CmdProc*)btree_integrity_check    },
-     { "btree_breakpoint",         (Tcl_CmdProc*)btree_breakpoint         },
      { "btree_varint_test",        (Tcl_CmdProc*)btree_varint_test        },
-     { "btree_begin_statement",    (Tcl_CmdProc*)btree_begin_statement    },
-     { "btree_commit_statement",   (Tcl_CmdProc*)btree_commit_statement   },
-     { "btree_rollback_statement", (Tcl_CmdProc*)btree_rollback_statement },
      { "btree_from_db",            (Tcl_CmdProc*)btree_from_db            },
-     { "btree_set_cache_size",     (Tcl_CmdProc*)btree_set_cache_size     },
-     { "btree_cursor_info",        (Tcl_CmdProc*)btree_cursor_info        },
-     { "btree_ovfl_info",          (Tcl_CmdProc*)btree_ovfl_info          },
-     { "btree_cursor_list",        (Tcl_CmdProc*)btree_cursor_list        },
-     { "btree_ismemdb",            (Tcl_CmdProc*)btree_ismemdb            },
+     { "btree_ismemdb",            (Tcl_CmdProc*)btree_ismemdb            }
   };
   int i;
 
@@ -1599,10 +606,5 @@ int Sqlitetest3_Init(Tcl_Interp *interp){
     Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
   }
 
-  /* The btree_insert command is implemented using the tcl 'object'
-  ** interface, not the string interface like the other commands in this
-  ** file. This is so binary data can be inserted into btree tables.
-  */
-  Tcl_CreateObjCommand(interp, "btree_insert", btree_insert, 0, 0);
   return TCL_OK;
 }
index e29399321ecbb9df0917114f1af69e90335ea06e..2767f5c0d0f98103a2863ac648cc66002f500b60 100644 (file)
@@ -13,7 +13,7 @@
 ** is not included in the SQLite library.  It is used for automated
 ** testing of the SQLite library.
 **
-** $Id: test_btree.c,v 1.8 2008/09/29 11:49:48 danielk1977 Exp $
+** $Id: test_btree.c,v 1.9 2009/07/09 02:48:24 shane Exp $
 */
 #include "btreeInt.h"
 #include <tcl.h>
@@ -62,81 +62,3 @@ void sqlite3BtreeCursorList(Btree *p){
   }
 #endif
 }
-
-
-/*
-** Fill aResult[] with information about the entry and page that the
-** cursor is pointing to.
-** 
-**   aResult[0] =  The page number
-**   aResult[1] =  The entry number
-**   aResult[2] =  Total number of entries on this page
-**   aResult[3] =  Cell size (local payload + header)
-**   aResult[4] =  Number of free bytes on this page
-**   aResult[5] =  Number of free blocks on the page
-**   aResult[6] =  Total payload size (local + overflow)
-**   aResult[7] =  Header size in bytes
-**   aResult[8] =  Local payload size
-**   aResult[9] =  Parent page number
-**   aResult[10]=  Page number of the first overflow page
-**
-** This routine is used for testing and debugging only.
-*/
-int sqlite3BtreeCursorInfo(BtCursor *pCur, int *aResult, int upCnt){
-#if 0
-  int cnt, idx;
-  MemPage *pPage = pCur->apPage[pCur->iPage];
-  BtCursor tmpCur;
-  int rc;
-
-  if( pCur->eState==CURSOR_REQUIRESEEK ){
-    rc = sqlite3BtreeRestoreCursorPosition(pCur);
-    if( rc!=SQLITE_OK ){
-      return rc;
-    }
-  }
-
-  assert( pPage->isInit );
-  sqlite3BtreeGetTempCursor(pCur, &tmpCur);
-  while( upCnt-- ){
-    sqlite3BtreeMoveToParent(&tmpCur);
-  }
-  pPage = tmpCur.pPage;
-  aResult[0] = sqlite3PagerPagenumber(pPage->pDbPage);
-  assert( aResult[0]==pPage->pgno );
-  aResult[1] = tmpCur.idx;
-  aResult[2] = pPage->nCell;
-  if( tmpCur.idx>=0 && tmpCur.idx<pPage->nCell ){
-    sqlite3BtreeParseCell(tmpCur.pPage, tmpCur.idx, &tmpCur.info);
-    aResult[3] = tmpCur.info.nSize;
-    aResult[6] = tmpCur.info.nData;
-    aResult[7] = tmpCur.info.nHeader;
-    aResult[8] = tmpCur.info.nLocal;
-  }else{
-    aResult[3] = 0;
-    aResult[6] = 0;
-    aResult[7] = 0;
-    aResult[8] = 0;
-  }
-  aResult[4] = pPage->nFree;
-  cnt = 0;
-  idx = get2byte(&pPage->aData[pPage->hdrOffset+1]);
-  while( idx>0 && idx<pPage->pBt->usableSize ){
-    cnt++;
-    idx = get2byte(&pPage->aData[idx]);
-  }
-  aResult[5] = cnt;
-  if( pPage->pParent==0 || sqlite3BtreeIsRootPage(pPage) ){
-    aResult[9] = 0;
-  }else{
-    aResult[9] = pPage->pParent->pgno;
-  }
-  if( tmpCur.info.iOverflow ){
-    aResult[10] = get4byte(&tmpCur.info.pCell[tmpCur.info.iOverflow]);
-  }else{
-    aResult[10] = 0;
-  }
-  sqlite3BtreeReleaseTempCursor(&tmpCur);
-#endif
-  return SQLITE_OK;
-}
index db0d2a915698e686bbf238a8f1b5f42883c5942d..a99a6245d5eebb503d44ce1f836158d4a5a635a7 100644 (file)
@@ -12,7 +12,7 @@
 # focus of this script is testing that the overflow-page related
 # enhancements added after version 3.3.17 speed things up.
 #
-# $Id: speed3.test,v 1.5 2007/10/09 08:29:33 danielk1977 Exp $
+# $Id: speed3.test,v 1.6 2009/07/09 02:48:24 shane Exp $
 #
 
 #---------------------------------------------------------------------
@@ -105,18 +105,6 @@ proc io_log {db} {
   puts "Normal    : Read $stats2(read), wrote $stats2(write)"
 }
 
-proc overflow_report {db} {
-  set bt [btree_from_db db]
-  set csr [btree_cursor $bt 3 0]
-
-  for {btree_first $csr} {![btree_eof $csr]} {btree_next $csr} {
-    puts "[btree_ovfl_info $bt $csr]"
-  }
-
-  btree_close_cursor $csr
-  
-}
-
 proc reset_db {} {
   db close
   sqlite3 db test.db
@@ -166,7 +154,6 @@ do_test speed3-0.4 {
 # Delete all content in a table, one row at a time.
 #
 #io_log db
-#overflow_report db
 reset_db
 speed_trial speed3-1.incrvacuum $::NROW row {DELETE FROM main.t1 WHERE 1}
 speed_trial speed3-1.normal     $::NROW row {DELETE FROM aux.t1 WHERE 1}
@@ -177,7 +164,6 @@ io_log db
 #
 #db eval {PRAGMA incremental_vacuum(500000)}
 populate_t1 db
-#overflow_report db
 reset_db
 speed_trial speed3-2.incrvacuum $::NROW row {SELECT c FROM main.t1}
 speed_trial speed3-2.normal     $::NROW row {SELECT c FROM aux.t1}