Remove leftover debugging commands (breakpoint and btree_breakpoint) from
test scripts. (CVS 5400)

FossilOrigin-Name: dcb160249fa2d592ad09b8b0052102dc44a93511
diff --git a/src/btree.c b/src/btree.c
index cf531b9..e20336a 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.481 2008/07/11 21:02:54 drh Exp $
+** $Id: btree.c,v 1.482 2008/07/12 14:52:20 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -27,8 +27,11 @@
 ** Set this global variable to 1 to enable tracing using the TRACE
 ** macro.
 */
-#if SQLITE_TEST
+#if 0
 int sqlite3BtreeTrace=0;  /* True to enable tracing */
+# define TRACE(X)  if(sqlite3BtreeTrace){printf X;fflush(stdout);}
+#else
+# define TRACE(X)
 #endif
 
 
diff --git a/src/btreeInt.h b/src/btreeInt.h
index 2fd4235..0216b63 100644
--- a/src/btreeInt.h
+++ b/src/btreeInt.h
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btreeInt.h,v 1.25 2008/07/11 21:02:54 drh Exp $
+** $Id: btreeInt.h,v 1.26 2008/07/12 14:52:20 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** For a detailed discussion of BTrees, refer to
@@ -481,17 +481,6 @@
 #define CURSOR_REQUIRESEEK       2
 #define CURSOR_FAULT             3
 
-/*
-** The TRACE macro will print high-level status information about the
-** btree operation when the global variable sqlite3BtreeTrace is
-** enabled.
-*/
-#if SQLITE_TEST
-# define TRACE(X)   if( sqlite3BtreeTrace ){ printf X; fflush(stdout); }
-#else
-# define TRACE(X)
-#endif
-
 /* The database page the PENDING_BYTE occupies. This page is never used.
 ** TODO: This macro is very similary to PAGER_MJ_PGNO() in pager.c. They
 ** should possibly be consolidated (presumably in pager.h).
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index acb6ffa..cd976f1 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.741 2008/07/11 16:15:18 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.742 2008/07/12 14:52:20 drh Exp $
 */
 #ifndef _SQLITEINT_H_
 #define _SQLITEINT_H_
@@ -1866,7 +1866,7 @@
   void sqlite3DebugPrintf(const char*, ...);
 #endif
 #if defined(SQLITE_TEST)
-  void *sqlite3TextToPtr(const char*);
+  void *sqlite3TestTextToPtr(const char*);
 #endif
 void sqlite3SetString(char **, sqlite3*, const char*, ...);
 void sqlite3ErrorMsg(Parse*, const char*, ...);
diff --git a/src/test1.c b/src/test1.c
index 7793efd..529ed84 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -13,7 +13,7 @@
 ** is not included in the SQLite library.  It is used for automated
 ** testing of the SQLite library.
 **
-** $Id: test1.c,v 1.314 2008/07/08 15:26:50 drh Exp $
+** $Id: test1.c,v 1.315 2008/07/12 14:52:20 drh Exp $
 */
 #include "sqliteInt.h"
 #include "tcl.h"
@@ -44,7 +44,7 @@
     return h - 'A' + 10;
   }
 }
-void *sqlite3TextToPtr(const char *z){
+void *sqlite3TestTextToPtr(const char *z){
   void *p;
   u64 v;
   u32 v2;
@@ -109,7 +109,7 @@
     p = (struct SqliteDb*)cmdInfo.objClientData;
     *ppDb = p->db;
   }else{
-    *ppDb = (sqlite3*)sqlite3TextToPtr(zA);
+    *ppDb = (sqlite3*)sqlite3TestTextToPtr(zA);
   }
   return TCL_OK;
 }
@@ -182,7 +182,7 @@
   const char *zArg,  
   sqlite3_stmt **ppStmt
 ){
-  *ppStmt = (sqlite3_stmt*)sqlite3TextToPtr(zArg);
+  *ppStmt = (sqlite3_stmt*)sqlite3TestTextToPtr(zArg);
   return TCL_OK;
 }
 
diff --git a/src/test2.c b/src/test2.c
index ae9f06e..c27a9fd 100644
--- a/src/test2.c
+++ b/src/test2.c
@@ -13,7 +13,7 @@
 ** is not included in the SQLite library.  It is used for automated
 ** testing of the SQLite library.
 **
-** $Id: test2.c,v 1.58 2008/06/07 08:58:22 danielk1977 Exp $
+** $Id: test2.c,v 1.59 2008/07/12 14:52:20 drh Exp $
 */
 #include "sqliteInt.h"
 #include "tcl.h"
@@ -110,7 +110,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerClose(pPager);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -137,7 +137,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerRollback(pPager);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -164,7 +164,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerCommitPhaseOne(pPager, 0, 0, 0);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -196,7 +196,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerStmtBegin(pPager);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -223,7 +223,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerStmtRollback(pPager);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -250,7 +250,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerStmtCommit(pPager);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -277,7 +277,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   a = sqlite3PagerStats(pPager);
   for(i=0; i<9; i++){
     static char *zName[] = {
@@ -311,7 +311,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   sqlite3PagerPagecount(pPager, &nPage);
   sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", nPage);
   Tcl_AppendResult(interp, zBuf, 0);
@@ -339,7 +339,7 @@
        " ID PGNO\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
   rc = sqlite3PagerGet(pPager, pgno, &pPage);
   if( rc!=SQLITE_OK ){
@@ -372,7 +372,7 @@
        " ID PGNO\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
   pPage = sqlite3PagerLookup(pPager, pgno);
   if( pPage ){
@@ -399,7 +399,7 @@
        " ID PGNO\"", 0);
     return TCL_ERROR;
   }
-  pPager = sqlite3TextToPtr(argv[1]);
+  pPager = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
   rc = sqlite3PagerTruncate(pPager, pgno);
   if( rc!=SQLITE_OK ){
@@ -428,7 +428,7 @@
        " PAGE\"", 0);
     return TCL_ERROR;
   }
-  pPage = (DbPage *)sqlite3TextToPtr(argv[1]);
+  pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerUnref(pPage);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -455,7 +455,7 @@
        " PAGE\"", 0);
     return TCL_ERROR;
   }
-  pPage = sqlite3TextToPtr(argv[1]);
+  pPage = sqlite3TestTextToPtr(argv[1]);
   memcpy(zBuf, sqlite3PagerGetData(pPage), sizeof(zBuf));
   Tcl_AppendResult(interp, zBuf, 0);
   return TCL_OK;
@@ -479,7 +479,7 @@
        " PAGE\"", 0);
     return TCL_ERROR;
   }
-  pPage = (DbPage *)sqlite3TextToPtr(argv[1]);
+  pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
   sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", sqlite3PagerPagenumber(pPage));
   Tcl_AppendResult(interp, zBuf, 0);
   return TCL_OK;
@@ -504,7 +504,7 @@
        " PAGE DATA\"", 0);
     return TCL_ERROR;
   }
-  pPage = (DbPage *)sqlite3TextToPtr(argv[1]);
+  pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3PagerWrite(pPage);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
diff --git a/src/test3.c b/src/test3.c
index 6445578..6b06dfc 100644
--- a/src/test3.c
+++ b/src/test3.c
@@ -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.99 2008/07/10 00:32:42 drh Exp $
+** $Id: test3.c,v 1.100 2008/07/12 14:52:20 drh Exp $
 */
 #include "sqliteInt.h"
 #include "btreeInt.h"
@@ -111,7 +111,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   rc = sqlite3BtreeClose(pBt);
   if( rc!=SQLITE_OK ){
     Tcl_AppendResult(interp, errorName(rc), 0);
@@ -146,7 +146,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeBeginTrans(pBt, 1);
   sqlite3BtreeLeave(pBt);
@@ -175,7 +175,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeRollback(pBt);
   sqlite3BtreeLeave(pBt);
@@ -204,7 +204,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeCommit(pBt);
   sqlite3BtreeLeave(pBt);
@@ -233,7 +233,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeBeginStmt(pBt);
   sqlite3BtreeLeave(pBt);
@@ -262,7 +262,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeRollbackStmt(pBt);
   sqlite3BtreeLeave(pBt);
@@ -291,7 +291,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeCommitStmt(pBt);
   sqlite3BtreeLeave(pBt);
@@ -321,7 +321,7 @@
        " ID FLAGS\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &flags) ) return TCL_ERROR;
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeCreateTable(pBt, &iTable, flags);
@@ -355,7 +355,7 @@
        " ID TABLENUM\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeDropTable(pBt, iTable, &notUsed1);
@@ -386,7 +386,7 @@
        " ID TABLENUM\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeClearTable(pBt, iTable);
@@ -417,7 +417,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   for(i=0; i<SQLITE_N_BTREE_META; i++){
     char zBuf[30];
     u32 v;
@@ -457,7 +457,7 @@
        " ID METADATA...\" (METADATA is ", zBuf, " integers)", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  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;
   }
@@ -493,7 +493,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
  
   /* Normally in this file, with a b-tree handle opened using the 
   ** [btree_open] command it is safe to call sqlite3BtreeEnter() directly.
@@ -548,7 +548,7 @@
        " ID ROOT ...\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   nRoot = argc-2;
   aRoot = (int*)sqlite3_malloc( sizeof(int)*(argc-2) );
   for(i=0; i<argc-2; i++){
@@ -587,7 +587,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pBt);
   sqlite3BtreeCursorList(pBt);
   sqlite3BtreeLeave(pBt);
@@ -617,7 +617,7 @@
        " ID TABLENUM WRITEABLE\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
   if( Tcl_GetBoolean(interp, argv[3], &wrFlag) ) return TCL_ERROR;
   pCur = (BtCursor *)ckalloc(sqlite3BtreeCursorSize());
@@ -655,7 +655,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   pBt = pCur->pBtree;
   sqlite3BtreeEnter(pBt);
   rc = sqlite3BtreeCloseCursor(pCur);
@@ -689,7 +689,7 @@
        " ID KEY\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
     int iKey;
@@ -732,7 +732,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   rc = sqlite3BtreeDelete(pCur);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -763,7 +763,7 @@
     Tcl_WrongNumArgs(interp, 1, objv, "ID KEY DATA ?NZERO?");
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(Tcl_GetString(objv[1]));
+  pCur = sqlite3TestTextToPtr(Tcl_GetString(objv[1]));
   if( objc==5 ){
     if( Tcl_GetIntFromObj(interp, objv[4], &nZero) ) return TCL_ERROR;
   }else{
@@ -820,7 +820,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   rc = sqlite3BtreeNext(pCur, &res);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -856,7 +856,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   rc = sqlite3BtreePrevious(pCur, &res);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -891,7 +891,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   rc = sqlite3BtreeFirst(pCur, &res);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -926,7 +926,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   rc = sqlite3BtreeLast(pCur, &res);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -960,7 +960,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   rc = sqlite3BtreeEof(pCur);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -990,7 +990,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   sqlite3BtreeKeySize(pCur, (i64*)&n);
   sqlite3BtreeLeave(pCur->pBtree);
@@ -1020,7 +1020,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   sqlite3BtreeKeySize(pCur, (i64*)&n);
   if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
@@ -1064,7 +1064,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   if( argc==2 ){
     sqlite3BtreeDataSize(pCur, &n);
@@ -1109,7 +1109,7 @@
        " ID AMT\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
   sqlite3BtreeEnter(pCur->pBtree);
   sqlite3BtreeKeySize(pCur, (i64*)&nKey);
@@ -1149,7 +1149,7 @@
        " ID AMT\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
   sqlite3BtreeEnter(pCur->pBtree);
   sqlite3BtreeDataSize(pCur, &nData);
@@ -1186,7 +1186,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   sqlite3BtreeEnter(pCur->pBtree);
   if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
     n1 = 0;
@@ -1236,7 +1236,7 @@
        " ID ?UP-CNT?\"", 0);
     return TCL_ERROR;
   }
-  pCur = sqlite3TextToPtr(argv[1]);
+  pCur = sqlite3TestTextToPtr(argv[1]);
   if( argc==3 ){
     if( Tcl_GetInt(interp, argv[2], &up) ) return TCL_ERROR;
   }else{
@@ -1296,8 +1296,8 @@
                     " BTREE CURSOR", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
-  pCur = sqlite3TextToPtr(argv[2]);
+  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);
@@ -1501,7 +1501,7 @@
        " BT NCACHE\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
 
   sqlite3_mutex_enter(pBt->db->mutex);
@@ -1532,7 +1532,7 @@
        " ID\"", 0);
     return TCL_ERROR;
   }
-  pBt = sqlite3TextToPtr(argv[1]);
+  pBt = sqlite3TestTextToPtr(argv[1]);
   sqlite3_mutex_enter(pBt->db->mutex);
   sqlite3BtreeEnter(pBt);
   res = sqlite3PagerIsMemdb(sqlite3BtreePager(pBt));
@@ -1547,7 +1547,6 @@
 ** Register commands with the TCL interpreter.
 */
 int Sqlitetest3_Init(Tcl_Interp *interp){
-  extern int sqlite3BtreeTrace;
   static struct {
      char *zName;
      Tcl_CmdProc *xProc;
@@ -1596,8 +1595,6 @@
   for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
     Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
   }
-  Tcl_LinkVar(interp, "btree_trace", (char*)&sqlite3BtreeTrace,
-     TCL_LINK_INT);
 
   /* The btree_insert command is implemented using the tcl 'object'
   ** interface, not the string interface like the other commands in this
diff --git a/src/where.c b/src/where.c
index 1b5a5f7..5971028 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.316 2008/07/11 16:15:18 drh Exp $
+** $Id: where.c,v 1.317 2008/07/12 14:52:20 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -30,6 +30,8 @@
 */
 #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
 int sqlite3WhereTrace = 0;
+#endif
+#if 0
 # define WHERETRACE(X)  if(sqlite3WhereTrace) sqlite3DebugPrintf X
 #else
 # define WHERETRACE(X)