/ Check-in [dcb16024]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove leftover debugging commands (breakpoint and btree_breakpoint) from test scripts. (CVS 5400)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dcb160249fa2d592ad09b8b0052102dc44a93511
User & Date: drh 2008-07-12 14:52:20
Context
2008-07-12
15:55
Fix the test script --binarylog option. (CVS 5401) check-in: 03e3cfc4 user: danielk1977 tags: trunk
14:52
Remove leftover debugging commands (breakpoint and btree_breakpoint) from test scripts. (CVS 5400) check-in: dcb16024 user: drh tags: trunk
2008-07-11
21:02
Detect and handles the case where a row is modified or deleted while it is being read during SELECT processing. (CVS 5399) check-in: c80a5d09 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.481 2008/07/11 21:02:54 drh Exp $
           12  +** $Id: btree.c,v 1.482 2008/07/12 14:52:20 drh Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** See the header comment on "btreeInt.h" for additional information.
    16     16   ** Including a description of file format and an overview of operation.
    17     17   */
    18     18   #include "btreeInt.h"
    19     19   
................................................................................
    23     23   */
    24     24   static const char zMagicHeader[] = SQLITE_FILE_HEADER;
    25     25   
    26     26   /*
    27     27   ** Set this global variable to 1 to enable tracing using the TRACE
    28     28   ** macro.
    29     29   */
    30         -#if SQLITE_TEST
           30  +#if 0
    31     31   int sqlite3BtreeTrace=0;  /* True to enable tracing */
           32  +# define TRACE(X)  if(sqlite3BtreeTrace){printf X;fflush(stdout);}
           33  +#else
           34  +# define TRACE(X)
    32     35   #endif
    33     36   
    34     37   
    35     38   
    36     39   #ifndef SQLITE_OMIT_SHARED_CACHE
    37     40   /*
    38     41   ** A flag to indicate whether or not shared cache is enabled.  Also,

Changes to src/btreeInt.h.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btreeInt.h,v 1.25 2008/07/11 21:02:54 drh Exp $
           12  +** $Id: btreeInt.h,v 1.26 2008/07/12 14:52:20 drh Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** For a detailed discussion of BTrees, refer to
    16     16   **
    17     17   **     Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3:
    18     18   **     "Sorting And Searching", pages 473-480. Addison-Wesley
    19     19   **     Publishing Company, Reading, Massachusetts.
................................................................................
   477    477   **   should return the error code stored in BtCursor.skip
   478    478   */
   479    479   #define CURSOR_INVALID           0
   480    480   #define CURSOR_VALID             1
   481    481   #define CURSOR_REQUIRESEEK       2
   482    482   #define CURSOR_FAULT             3
   483    483   
   484         -/*
   485         -** The TRACE macro will print high-level status information about the
   486         -** btree operation when the global variable sqlite3BtreeTrace is
   487         -** enabled.
   488         -*/
   489         -#if SQLITE_TEST
   490         -# define TRACE(X)   if( sqlite3BtreeTrace ){ printf X; fflush(stdout); }
   491         -#else
   492         -# define TRACE(X)
   493         -#endif
   494         -
   495    484   /* The database page the PENDING_BYTE occupies. This page is never used.
   496    485   ** TODO: This macro is very similary to PAGER_MJ_PGNO() in pager.c. They
   497    486   ** should possibly be consolidated (presumably in pager.h).
   498    487   **
   499    488   ** If disk I/O is omitted (meaning that the database is stored purely
   500    489   ** in memory) then there is no pending byte.
   501    490   */

Changes to src/sqliteInt.h.

     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Internal interface definitions for SQLite.
    13     13   **
    14         -** @(#) $Id: sqliteInt.h,v 1.741 2008/07/11 16:15:18 drh Exp $
           14  +** @(#) $Id: sqliteInt.h,v 1.742 2008/07/12 14:52:20 drh Exp $
    15     15   */
    16     16   #ifndef _SQLITEINT_H_
    17     17   #define _SQLITEINT_H_
    18     18   
    19     19   /*
    20     20   ** Include the configuration header output by 'configure' if we're using the
    21     21   ** autoconf-based build
................................................................................
  1862   1862   void sqlite3VXPrintf(StrAccum*, int, const char*, va_list);
  1863   1863   char *sqlite3MPrintf(sqlite3*,const char*, ...);
  1864   1864   char *sqlite3VMPrintf(sqlite3*,const char*, va_list);
  1865   1865   #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
  1866   1866     void sqlite3DebugPrintf(const char*, ...);
  1867   1867   #endif
  1868   1868   #if defined(SQLITE_TEST)
  1869         -  void *sqlite3TextToPtr(const char*);
         1869  +  void *sqlite3TestTextToPtr(const char*);
  1870   1870   #endif
  1871   1871   void sqlite3SetString(char **, sqlite3*, const char*, ...);
  1872   1872   void sqlite3ErrorMsg(Parse*, const char*, ...);
  1873   1873   void sqlite3ErrorClear(Parse*);
  1874   1874   void sqlite3Dequote(char*);
  1875   1875   void sqlite3DequoteExpr(sqlite3*, Expr*);
  1876   1876   int sqlite3KeywordCode(const unsigned char*, int);

Changes to src/test1.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing all sorts of SQLite interfaces.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test1.c,v 1.314 2008/07/08 15:26:50 drh Exp $
           16  +** $Id: test1.c,v 1.315 2008/07/12 14:52:20 drh Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include <stdlib.h>
    21     21   #include <string.h>
    22     22   
    23     23   /*
................................................................................
    40     40     }else if( h>='a' && h<='f' ){
    41     41       return h - 'a' + 10;
    42     42     }else{
    43     43       assert( h>='A' && h<='F' );
    44     44       return h - 'A' + 10;
    45     45     }
    46     46   }
    47         -void *sqlite3TextToPtr(const char *z){
           47  +void *sqlite3TestTextToPtr(const char *z){
    48     48     void *p;
    49     49     u64 v;
    50     50     u32 v2;
    51     51     if( z[0]=='0' && z[1]=='x' ){
    52     52       z += 2;
    53     53     }
    54     54     v = 0;
................................................................................
   105    105   int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite3 **ppDb){
   106    106     struct SqliteDb *p;
   107    107     Tcl_CmdInfo cmdInfo;
   108    108     if( Tcl_GetCommandInfo(interp, zA, &cmdInfo) ){
   109    109       p = (struct SqliteDb*)cmdInfo.objClientData;
   110    110       *ppDb = p->db;
   111    111     }else{
   112         -    *ppDb = (sqlite3*)sqlite3TextToPtr(zA);
          112  +    *ppDb = (sqlite3*)sqlite3TestTextToPtr(zA);
   113    113     }
   114    114     return TCL_OK;
   115    115   }
   116    116   
   117    117   
   118    118   const char *sqlite3TestErrorName(int rc){
   119    119     const char *zName = 0;
................................................................................
   178    178   ** Decode a pointer to an sqlite3_stmt object.
   179    179   */
   180    180   static int getStmtPointer(
   181    181     Tcl_Interp *interp, 
   182    182     const char *zArg,  
   183    183     sqlite3_stmt **ppStmt
   184    184   ){
   185         -  *ppStmt = (sqlite3_stmt*)sqlite3TextToPtr(zArg);
          185  +  *ppStmt = (sqlite3_stmt*)sqlite3TestTextToPtr(zArg);
   186    186     return TCL_OK;
   187    187   }
   188    188   
   189    189   /*
   190    190   ** Generate a text representation of a pointer that can be understood
   191    191   ** by the getDbPointer and getVmPointer routines above.
   192    192   **

Changes to src/test2.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing the pager.c module in SQLite.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test2.c,v 1.58 2008/06/07 08:58:22 danielk1977 Exp $
           16  +** $Id: test2.c,v 1.59 2008/07/12 14:52:20 drh Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include <stdlib.h>
    21     21   #include <string.h>
    22     22   #include <ctype.h>
    23     23   
................................................................................
   106    106     Pager *pPager;
   107    107     int rc;
   108    108     if( argc!=2 ){
   109    109       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   110    110          " ID\"", 0);
   111    111       return TCL_ERROR;
   112    112     }
   113         -  pPager = sqlite3TextToPtr(argv[1]);
          113  +  pPager = sqlite3TestTextToPtr(argv[1]);
   114    114     rc = sqlite3PagerClose(pPager);
   115    115     if( rc!=SQLITE_OK ){
   116    116       Tcl_AppendResult(interp, errorName(rc), 0);
   117    117       return TCL_ERROR;
   118    118     }
   119    119     return TCL_OK;
   120    120   }
................................................................................
   133    133     Pager *pPager;
   134    134     int rc;
   135    135     if( argc!=2 ){
   136    136       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   137    137          " ID\"", 0);
   138    138       return TCL_ERROR;
   139    139     }
   140         -  pPager = sqlite3TextToPtr(argv[1]);
          140  +  pPager = sqlite3TestTextToPtr(argv[1]);
   141    141     rc = sqlite3PagerRollback(pPager);
   142    142     if( rc!=SQLITE_OK ){
   143    143       Tcl_AppendResult(interp, errorName(rc), 0);
   144    144       return TCL_ERROR;
   145    145     }
   146    146     return TCL_OK;
   147    147   }
................................................................................
   160    160     Pager *pPager;
   161    161     int rc;
   162    162     if( argc!=2 ){
   163    163       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   164    164          " ID\"", 0);
   165    165       return TCL_ERROR;
   166    166     }
   167         -  pPager = sqlite3TextToPtr(argv[1]);
          167  +  pPager = sqlite3TestTextToPtr(argv[1]);
   168    168     rc = sqlite3PagerCommitPhaseOne(pPager, 0, 0, 0);
   169    169     if( rc!=SQLITE_OK ){
   170    170       Tcl_AppendResult(interp, errorName(rc), 0);
   171    171       return TCL_ERROR;
   172    172     }
   173    173     rc = sqlite3PagerCommitPhaseTwo(pPager);
   174    174     if( rc!=SQLITE_OK ){
................................................................................
   192    192     Pager *pPager;
   193    193     int rc;
   194    194     if( argc!=2 ){
   195    195       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   196    196          " ID\"", 0);
   197    197       return TCL_ERROR;
   198    198     }
   199         -  pPager = sqlite3TextToPtr(argv[1]);
          199  +  pPager = sqlite3TestTextToPtr(argv[1]);
   200    200     rc = sqlite3PagerStmtBegin(pPager);
   201    201     if( rc!=SQLITE_OK ){
   202    202       Tcl_AppendResult(interp, errorName(rc), 0);
   203    203       return TCL_ERROR;
   204    204     }
   205    205     return TCL_OK;
   206    206   }
................................................................................
   219    219     Pager *pPager;
   220    220     int rc;
   221    221     if( argc!=2 ){
   222    222       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   223    223          " ID\"", 0);
   224    224       return TCL_ERROR;
   225    225     }
   226         -  pPager = sqlite3TextToPtr(argv[1]);
          226  +  pPager = sqlite3TestTextToPtr(argv[1]);
   227    227     rc = sqlite3PagerStmtRollback(pPager);
   228    228     if( rc!=SQLITE_OK ){
   229    229       Tcl_AppendResult(interp, errorName(rc), 0);
   230    230       return TCL_ERROR;
   231    231     }
   232    232     return TCL_OK;
   233    233   }
................................................................................
   246    246     Pager *pPager;
   247    247     int rc;
   248    248     if( argc!=2 ){
   249    249       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   250    250          " ID\"", 0);
   251    251       return TCL_ERROR;
   252    252     }
   253         -  pPager = sqlite3TextToPtr(argv[1]);
          253  +  pPager = sqlite3TestTextToPtr(argv[1]);
   254    254     rc = sqlite3PagerStmtCommit(pPager);
   255    255     if( rc!=SQLITE_OK ){
   256    256       Tcl_AppendResult(interp, errorName(rc), 0);
   257    257       return TCL_ERROR;
   258    258     }
   259    259     return TCL_OK;
   260    260   }
................................................................................
   273    273     Pager *pPager;
   274    274     int i, *a;
   275    275     if( argc!=2 ){
   276    276       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   277    277          " ID\"", 0);
   278    278       return TCL_ERROR;
   279    279     }
   280         -  pPager = sqlite3TextToPtr(argv[1]);
          280  +  pPager = sqlite3TestTextToPtr(argv[1]);
   281    281     a = sqlite3PagerStats(pPager);
   282    282     for(i=0; i<9; i++){
   283    283       static char *zName[] = {
   284    284         "ref", "page", "max", "size", "state", "err",
   285    285         "hit", "miss", "ovfl",
   286    286       };
   287    287       char zBuf[100];
................................................................................
   307    307     char zBuf[100];
   308    308     int nPage;
   309    309     if( argc!=2 ){
   310    310       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   311    311          " ID\"", 0);
   312    312       return TCL_ERROR;
   313    313     }
   314         -  pPager = sqlite3TextToPtr(argv[1]);
          314  +  pPager = sqlite3TestTextToPtr(argv[1]);
   315    315     sqlite3PagerPagecount(pPager, &nPage);
   316    316     sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", nPage);
   317    317     Tcl_AppendResult(interp, zBuf, 0);
   318    318     return TCL_OK;
   319    319   }
   320    320   
   321    321   /*
................................................................................
   335    335     int pgno;
   336    336     int rc;
   337    337     if( argc!=3 ){
   338    338       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   339    339          " ID PGNO\"", 0);
   340    340       return TCL_ERROR;
   341    341     }
   342         -  pPager = sqlite3TextToPtr(argv[1]);
          342  +  pPager = sqlite3TestTextToPtr(argv[1]);
   343    343     if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
   344    344     rc = sqlite3PagerGet(pPager, pgno, &pPage);
   345    345     if( rc!=SQLITE_OK ){
   346    346       Tcl_AppendResult(interp, errorName(rc), 0);
   347    347       return TCL_ERROR;
   348    348     }
   349    349     sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage);
................................................................................
   368    368     DbPage *pPage;
   369    369     int pgno;
   370    370     if( argc!=3 ){
   371    371       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   372    372          " ID PGNO\"", 0);
   373    373       return TCL_ERROR;
   374    374     }
   375         -  pPager = sqlite3TextToPtr(argv[1]);
          375  +  pPager = sqlite3TestTextToPtr(argv[1]);
   376    376     if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
   377    377     pPage = sqlite3PagerLookup(pPager, pgno);
   378    378     if( pPage ){
   379    379       sqlite3_snprintf(sizeof(zBuf),zBuf,"%p",pPage);
   380    380       Tcl_AppendResult(interp, zBuf, 0);
   381    381     }
   382    382     return TCL_OK;
................................................................................
   395    395     int rc;
   396    396     int pgno;
   397    397     if( argc!=3 ){
   398    398       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   399    399          " ID PGNO\"", 0);
   400    400       return TCL_ERROR;
   401    401     }
   402         -  pPager = sqlite3TextToPtr(argv[1]);
          402  +  pPager = sqlite3TestTextToPtr(argv[1]);
   403    403     if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR;
   404    404     rc = sqlite3PagerTruncate(pPager, pgno);
   405    405     if( rc!=SQLITE_OK ){
   406    406       Tcl_AppendResult(interp, errorName(rc), 0);
   407    407       return TCL_ERROR;
   408    408     }
   409    409     return TCL_OK;
................................................................................
   424    424     DbPage *pPage;
   425    425     int rc;
   426    426     if( argc!=2 ){
   427    427       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   428    428          " PAGE\"", 0);
   429    429       return TCL_ERROR;
   430    430     }
   431         -  pPage = (DbPage *)sqlite3TextToPtr(argv[1]);
          431  +  pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
   432    432     rc = sqlite3PagerUnref(pPage);
   433    433     if( rc!=SQLITE_OK ){
   434    434       Tcl_AppendResult(interp, errorName(rc), 0);
   435    435       return TCL_ERROR;
   436    436     }
   437    437     return TCL_OK;
   438    438   }
................................................................................
   451    451     char zBuf[100];
   452    452     DbPage *pPage;
   453    453     if( argc!=2 ){
   454    454       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   455    455          " PAGE\"", 0);
   456    456       return TCL_ERROR;
   457    457     }
   458         -  pPage = sqlite3TextToPtr(argv[1]);
          458  +  pPage = sqlite3TestTextToPtr(argv[1]);
   459    459     memcpy(zBuf, sqlite3PagerGetData(pPage), sizeof(zBuf));
   460    460     Tcl_AppendResult(interp, zBuf, 0);
   461    461     return TCL_OK;
   462    462   }
   463    463   
   464    464   /*
   465    465   ** Usage:   page_number PAGE
................................................................................
   475    475     char zBuf[100];
   476    476     DbPage *pPage;
   477    477     if( argc!=2 ){
   478    478       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   479    479          " PAGE\"", 0);
   480    480       return TCL_ERROR;
   481    481     }
   482         -  pPage = (DbPage *)sqlite3TextToPtr(argv[1]);
          482  +  pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
   483    483     sqlite3_snprintf(sizeof(zBuf), zBuf, "%d", sqlite3PagerPagenumber(pPage));
   484    484     Tcl_AppendResult(interp, zBuf, 0);
   485    485     return TCL_OK;
   486    486   }
   487    487   
   488    488   /*
   489    489   ** Usage:   page_write PAGE DATA
................................................................................
   500    500     char *pData;
   501    501     int rc;
   502    502     if( argc!=3 ){
   503    503       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   504    504          " PAGE DATA\"", 0);
   505    505       return TCL_ERROR;
   506    506     }
   507         -  pPage = (DbPage *)sqlite3TextToPtr(argv[1]);
          507  +  pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]);
   508    508     rc = sqlite3PagerWrite(pPage);
   509    509     if( rc!=SQLITE_OK ){
   510    510       Tcl_AppendResult(interp, errorName(rc), 0);
   511    511       return TCL_ERROR;
   512    512     }
   513    513     pData = sqlite3PagerGetData(pPage);
   514    514     strncpy(pData, argv[2], test_pagesize-1);

Changes to src/test3.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing the btree.c module in SQLite.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test3.c,v 1.99 2008/07/10 00:32:42 drh Exp $
           16  +** $Id: test3.c,v 1.100 2008/07/12 14:52:20 drh Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "btreeInt.h"
    20     20   #include "tcl.h"
    21     21   #include <stdlib.h>
    22     22   #include <string.h>
    23     23   
................................................................................
   107    107     Btree *pBt;
   108    108     int rc;
   109    109     if( argc!=2 ){
   110    110       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   111    111          " ID\"", 0);
   112    112       return TCL_ERROR;
   113    113     }
   114         -  pBt = sqlite3TextToPtr(argv[1]);
          114  +  pBt = sqlite3TestTextToPtr(argv[1]);
   115    115     rc = sqlite3BtreeClose(pBt);
   116    116     if( rc!=SQLITE_OK ){
   117    117       Tcl_AppendResult(interp, errorName(rc), 0);
   118    118       return TCL_ERROR;
   119    119     }
   120    120     nRefSqlite3--;
   121    121     if( nRefSqlite3==0 ){
................................................................................
   142    142     Btree *pBt;
   143    143     int rc;
   144    144     if( argc!=2 ){
   145    145       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   146    146          " ID\"", 0);
   147    147       return TCL_ERROR;
   148    148     }
   149         -  pBt = sqlite3TextToPtr(argv[1]);
          149  +  pBt = sqlite3TestTextToPtr(argv[1]);
   150    150     sqlite3BtreeEnter(pBt);
   151    151     rc = sqlite3BtreeBeginTrans(pBt, 1);
   152    152     sqlite3BtreeLeave(pBt);
   153    153     if( rc!=SQLITE_OK ){
   154    154       Tcl_AppendResult(interp, errorName(rc), 0);
   155    155       return TCL_ERROR;
   156    156     }
................................................................................
   171    171     Btree *pBt;
   172    172     int rc;
   173    173     if( argc!=2 ){
   174    174       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   175    175          " ID\"", 0);
   176    176       return TCL_ERROR;
   177    177     }
   178         -  pBt = sqlite3TextToPtr(argv[1]);
          178  +  pBt = sqlite3TestTextToPtr(argv[1]);
   179    179     sqlite3BtreeEnter(pBt);
   180    180     rc = sqlite3BtreeRollback(pBt);
   181    181     sqlite3BtreeLeave(pBt);
   182    182     if( rc!=SQLITE_OK ){
   183    183       Tcl_AppendResult(interp, errorName(rc), 0);
   184    184       return TCL_ERROR;
   185    185     }
................................................................................
   200    200     Btree *pBt;
   201    201     int rc;
   202    202     if( argc!=2 ){
   203    203       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   204    204          " ID\"", 0);
   205    205       return TCL_ERROR;
   206    206     }
   207         -  pBt = sqlite3TextToPtr(argv[1]);
          207  +  pBt = sqlite3TestTextToPtr(argv[1]);
   208    208     sqlite3BtreeEnter(pBt);
   209    209     rc = sqlite3BtreeCommit(pBt);
   210    210     sqlite3BtreeLeave(pBt);
   211    211     if( rc!=SQLITE_OK ){
   212    212       Tcl_AppendResult(interp, errorName(rc), 0);
   213    213       return TCL_ERROR;
   214    214     }
................................................................................
   229    229     Btree *pBt;
   230    230     int rc;
   231    231     if( argc!=2 ){
   232    232       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   233    233          " ID\"", 0);
   234    234       return TCL_ERROR;
   235    235     }
   236         -  pBt = sqlite3TextToPtr(argv[1]);
          236  +  pBt = sqlite3TestTextToPtr(argv[1]);
   237    237     sqlite3BtreeEnter(pBt);
   238    238     rc = sqlite3BtreeBeginStmt(pBt);
   239    239     sqlite3BtreeLeave(pBt);
   240    240     if( rc!=SQLITE_OK ){
   241    241       Tcl_AppendResult(interp, errorName(rc), 0);
   242    242       return TCL_ERROR;
   243    243     }
................................................................................
   258    258     Btree *pBt;
   259    259     int rc;
   260    260     if( argc!=2 ){
   261    261       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   262    262          " ID\"", 0);
   263    263       return TCL_ERROR;
   264    264     }
   265         -  pBt = sqlite3TextToPtr(argv[1]);
          265  +  pBt = sqlite3TestTextToPtr(argv[1]);
   266    266     sqlite3BtreeEnter(pBt);
   267    267     rc = sqlite3BtreeRollbackStmt(pBt);
   268    268     sqlite3BtreeLeave(pBt);
   269    269     if( rc!=SQLITE_OK ){
   270    270       Tcl_AppendResult(interp, errorName(rc), 0);
   271    271       return TCL_ERROR;
   272    272     }
................................................................................
   287    287     Btree *pBt;
   288    288     int rc;
   289    289     if( argc!=2 ){
   290    290       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   291    291          " ID\"", 0);
   292    292       return TCL_ERROR;
   293    293     }
   294         -  pBt = sqlite3TextToPtr(argv[1]);
          294  +  pBt = sqlite3TestTextToPtr(argv[1]);
   295    295     sqlite3BtreeEnter(pBt);
   296    296     rc = sqlite3BtreeCommitStmt(pBt);
   297    297     sqlite3BtreeLeave(pBt);
   298    298     if( rc!=SQLITE_OK ){
   299    299       Tcl_AppendResult(interp, errorName(rc), 0);
   300    300       return TCL_ERROR;
   301    301     }
................................................................................
   317    317     int rc, iTable, flags;
   318    318     char zBuf[30];
   319    319     if( argc!=3 ){
   320    320       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   321    321          " ID FLAGS\"", 0);
   322    322       return TCL_ERROR;
   323    323     }
   324         -  pBt = sqlite3TextToPtr(argv[1]);
          324  +  pBt = sqlite3TestTextToPtr(argv[1]);
   325    325     if( Tcl_GetInt(interp, argv[2], &flags) ) return TCL_ERROR;
   326    326     sqlite3BtreeEnter(pBt);
   327    327     rc = sqlite3BtreeCreateTable(pBt, &iTable, flags);
   328    328     sqlite3BtreeLeave(pBt);
   329    329     if( rc!=SQLITE_OK ){
   330    330       Tcl_AppendResult(interp, errorName(rc), 0);
   331    331       return TCL_ERROR;
................................................................................
   351    351     int rc;
   352    352     int notUsed1;
   353    353     if( argc!=3 ){
   354    354       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   355    355          " ID TABLENUM\"", 0);
   356    356       return TCL_ERROR;
   357    357     }
   358         -  pBt = sqlite3TextToPtr(argv[1]);
          358  +  pBt = sqlite3TestTextToPtr(argv[1]);
   359    359     if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
   360    360     sqlite3BtreeEnter(pBt);
   361    361     rc = sqlite3BtreeDropTable(pBt, iTable, &notUsed1);
   362    362     sqlite3BtreeLeave(pBt);
   363    363     if( rc!=SQLITE_OK ){
   364    364       Tcl_AppendResult(interp, errorName(rc), 0);
   365    365       return TCL_ERROR;
................................................................................
   382    382     int iTable;
   383    383     int rc;
   384    384     if( argc!=3 ){
   385    385       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   386    386          " ID TABLENUM\"", 0);
   387    387       return TCL_ERROR;
   388    388     }
   389         -  pBt = sqlite3TextToPtr(argv[1]);
          389  +  pBt = sqlite3TestTextToPtr(argv[1]);
   390    390     if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
   391    391     sqlite3BtreeEnter(pBt);
   392    392     rc = sqlite3BtreeClearTable(pBt, iTable);
   393    393     sqlite3BtreeLeave(pBt);
   394    394     if( rc!=SQLITE_OK ){
   395    395       Tcl_AppendResult(interp, errorName(rc), 0);
   396    396       return TCL_ERROR;
................................................................................
   413    413     int rc;
   414    414     int i;
   415    415     if( argc!=2 ){
   416    416       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   417    417          " ID\"", 0);
   418    418       return TCL_ERROR;
   419    419     }
   420         -  pBt = sqlite3TextToPtr(argv[1]);
          420  +  pBt = sqlite3TestTextToPtr(argv[1]);
   421    421     for(i=0; i<SQLITE_N_BTREE_META; i++){
   422    422       char zBuf[30];
   423    423       u32 v;
   424    424       sqlite3BtreeEnter(pBt);
   425    425       rc = sqlite3BtreeGetMeta(pBt, i, &v);
   426    426       sqlite3BtreeLeave(pBt);
   427    427       if( rc!=SQLITE_OK ){
................................................................................
   453    453     if( argc!=2+SQLITE_N_BTREE_META ){
   454    454       char zBuf[30];
   455    455       sqlite3_snprintf(sizeof(zBuf), zBuf,"%d",SQLITE_N_BTREE_META);
   456    456       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   457    457          " ID METADATA...\" (METADATA is ", zBuf, " integers)", 0);
   458    458       return TCL_ERROR;
   459    459     }
   460         -  pBt = sqlite3TextToPtr(argv[1]);
          460  +  pBt = sqlite3TestTextToPtr(argv[1]);
   461    461     for(i=1; i<SQLITE_N_BTREE_META; i++){
   462    462       if( Tcl_GetInt(interp, argv[i+2], &aMeta[i]) ) return TCL_ERROR;
   463    463     }
   464    464     for(i=1; i<SQLITE_N_BTREE_META; i++){
   465    465       sqlite3BtreeEnter(pBt);
   466    466       rc = sqlite3BtreeUpdateMeta(pBt, i, aMeta[i]);
   467    467       sqlite3BtreeLeave(pBt);
................................................................................
   489    489     int *a;
   490    490   
   491    491     if( argc!=2 ){
   492    492       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   493    493          " ID\"", 0);
   494    494       return TCL_ERROR;
   495    495     }
   496         -  pBt = sqlite3TextToPtr(argv[1]);
          496  +  pBt = sqlite3TestTextToPtr(argv[1]);
   497    497    
   498    498     /* Normally in this file, with a b-tree handle opened using the 
   499    499     ** [btree_open] command it is safe to call sqlite3BtreeEnter() directly.
   500    500     ** But this function is sometimes called with a btree handle obtained
   501    501     ** from an open SQLite connection (using [btree_from_db]). In this case
   502    502     ** we need to obtain the mutex for the controlling SQLite handle before
   503    503     ** it is safe to call sqlite3BtreeEnter().
................................................................................
   544    544     char *zResult;
   545    545   
   546    546     if( argc<3 ){
   547    547       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   548    548          " ID ROOT ...\"", 0);
   549    549       return TCL_ERROR;
   550    550     }
   551         -  pBt = sqlite3TextToPtr(argv[1]);
          551  +  pBt = sqlite3TestTextToPtr(argv[1]);
   552    552     nRoot = argc-2;
   553    553     aRoot = (int*)sqlite3_malloc( sizeof(int)*(argc-2) );
   554    554     for(i=0; i<argc-2; i++){
   555    555       if( Tcl_GetInt(interp, argv[i+2], &aRoot[i]) ) return TCL_ERROR;
   556    556     }
   557    557   #ifndef SQLITE_OMIT_INTEGRITY_CHECK
   558    558     sqlite3BtreeEnter(pBt);
................................................................................
   583    583     Btree *pBt;
   584    584   
   585    585     if( argc!=2 ){
   586    586       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   587    587          " ID\"", 0);
   588    588       return TCL_ERROR;
   589    589     }
   590         -  pBt = sqlite3TextToPtr(argv[1]);
          590  +  pBt = sqlite3TestTextToPtr(argv[1]);
   591    591     sqlite3BtreeEnter(pBt);
   592    592     sqlite3BtreeCursorList(pBt);
   593    593     sqlite3BtreeLeave(pBt);
   594    594     return SQLITE_OK;
   595    595   }
   596    596   
   597    597   /*
................................................................................
   613    613     char zBuf[30];
   614    614   
   615    615     if( argc!=4 ){
   616    616       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   617    617          " ID TABLENUM WRITEABLE\"", 0);
   618    618       return TCL_ERROR;
   619    619     }
   620         -  pBt = sqlite3TextToPtr(argv[1]);
          620  +  pBt = sqlite3TestTextToPtr(argv[1]);
   621    621     if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
   622    622     if( Tcl_GetBoolean(interp, argv[3], &wrFlag) ) return TCL_ERROR;
   623    623     pCur = (BtCursor *)ckalloc(sqlite3BtreeCursorSize());
   624    624     memset(pCur, 0, sqlite3BtreeCursorSize());
   625    625     sqlite3BtreeEnter(pBt);
   626    626     rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, pCur);
   627    627     sqlite3BtreeLeave(pBt);
................................................................................
   651    651     int rc;
   652    652   
   653    653     if( argc!=2 ){
   654    654       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   655    655          " ID\"", 0);
   656    656       return TCL_ERROR;
   657    657     }
   658         -  pCur = sqlite3TextToPtr(argv[1]);
          658  +  pCur = sqlite3TestTextToPtr(argv[1]);
   659    659     pBt = pCur->pBtree;
   660    660     sqlite3BtreeEnter(pBt);
   661    661     rc = sqlite3BtreeCloseCursor(pCur);
   662    662     sqlite3BtreeLeave(pBt);
   663    663     ckfree((char *)pCur);
   664    664     if( rc ){
   665    665       Tcl_AppendResult(interp, errorName(rc), 0);
................................................................................
   685    685     char zBuf[20];
   686    686   
   687    687     if( argc!=3 ){
   688    688       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   689    689          " ID KEY\"", 0);
   690    690       return TCL_ERROR;
   691    691     }
   692         -  pCur = sqlite3TextToPtr(argv[1]);
          692  +  pCur = sqlite3TestTextToPtr(argv[1]);
   693    693     sqlite3BtreeEnter(pCur->pBtree);
   694    694     if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
   695    695       int iKey;
   696    696       if( Tcl_GetInt(interp, argv[2], &iKey) ){
   697    697         sqlite3BtreeLeave(pCur->pBtree);
   698    698         return TCL_ERROR;
   699    699       }
................................................................................
   728    728     int rc;
   729    729   
   730    730     if( argc!=2 ){
   731    731       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   732    732          " ID\"", 0);
   733    733       return TCL_ERROR;
   734    734     }
   735         -  pCur = sqlite3TextToPtr(argv[1]);
          735  +  pCur = sqlite3TestTextToPtr(argv[1]);
   736    736     sqlite3BtreeEnter(pCur->pBtree);
   737    737     rc = sqlite3BtreeDelete(pCur);
   738    738     sqlite3BtreeLeave(pCur->pBtree);
   739    739     if( rc ){
   740    740       Tcl_AppendResult(interp, errorName(rc), 0);
   741    741       return TCL_ERROR;
   742    742     }
................................................................................
   759    759     int rc;
   760    760     int nZero;
   761    761   
   762    762     if( objc!=4 && objc!=5 ){
   763    763       Tcl_WrongNumArgs(interp, 1, objv, "ID KEY DATA ?NZERO?");
   764    764       return TCL_ERROR;
   765    765     }
   766         -  pCur = sqlite3TextToPtr(Tcl_GetString(objv[1]));
          766  +  pCur = sqlite3TestTextToPtr(Tcl_GetString(objv[1]));
   767    767     if( objc==5 ){
   768    768       if( Tcl_GetIntFromObj(interp, objv[4], &nZero) ) return TCL_ERROR;
   769    769     }else{
   770    770       nZero = 0;
   771    771     }
   772    772     sqlite3BtreeEnter(pCur->pBtree);
   773    773     if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
................................................................................
   816    816     char zBuf[100];
   817    817   
   818    818     if( argc!=2 ){
   819    819       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   820    820          " ID\"", 0);
   821    821       return TCL_ERROR;
   822    822     }
   823         -  pCur = sqlite3TextToPtr(argv[1]);
          823  +  pCur = sqlite3TestTextToPtr(argv[1]);
   824    824     sqlite3BtreeEnter(pCur->pBtree);
   825    825     rc = sqlite3BtreeNext(pCur, &res);
   826    826     sqlite3BtreeLeave(pCur->pBtree);
   827    827     if( rc ){
   828    828       Tcl_AppendResult(interp, errorName(rc), 0);
   829    829       return TCL_ERROR;
   830    830     }
................................................................................
   852    852     char zBuf[100];
   853    853   
   854    854     if( argc!=2 ){
   855    855       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   856    856          " ID\"", 0);
   857    857       return TCL_ERROR;
   858    858     }
   859         -  pCur = sqlite3TextToPtr(argv[1]);
          859  +  pCur = sqlite3TestTextToPtr(argv[1]);
   860    860     sqlite3BtreeEnter(pCur->pBtree);
   861    861     rc = sqlite3BtreePrevious(pCur, &res);
   862    862     sqlite3BtreeLeave(pCur->pBtree);
   863    863     if( rc ){
   864    864       Tcl_AppendResult(interp, errorName(rc), 0);
   865    865       return TCL_ERROR;
   866    866     }
................................................................................
   887    887     char zBuf[100];
   888    888   
   889    889     if( argc!=2 ){
   890    890       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   891    891          " ID\"", 0);
   892    892       return TCL_ERROR;
   893    893     }
   894         -  pCur = sqlite3TextToPtr(argv[1]);
          894  +  pCur = sqlite3TestTextToPtr(argv[1]);
   895    895     sqlite3BtreeEnter(pCur->pBtree);
   896    896     rc = sqlite3BtreeFirst(pCur, &res);
   897    897     sqlite3BtreeLeave(pCur->pBtree);
   898    898     if( rc ){
   899    899       Tcl_AppendResult(interp, errorName(rc), 0);
   900    900       return TCL_ERROR;
   901    901     }
................................................................................
   922    922     char zBuf[100];
   923    923   
   924    924     if( argc!=2 ){
   925    925       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   926    926          " ID\"", 0);
   927    927       return TCL_ERROR;
   928    928     }
   929         -  pCur = sqlite3TextToPtr(argv[1]);
          929  +  pCur = sqlite3TestTextToPtr(argv[1]);
   930    930     sqlite3BtreeEnter(pCur->pBtree);
   931    931     rc = sqlite3BtreeLast(pCur, &res);
   932    932     sqlite3BtreeLeave(pCur->pBtree);
   933    933     if( rc ){
   934    934       Tcl_AppendResult(interp, errorName(rc), 0);
   935    935       return TCL_ERROR;
   936    936     }
................................................................................
   956    956     char zBuf[50];
   957    957   
   958    958     if( argc!=2 ){
   959    959       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   960    960          " ID\"", 0);
   961    961       return TCL_ERROR;
   962    962     }
   963         -  pCur = sqlite3TextToPtr(argv[1]);
          963  +  pCur = sqlite3TestTextToPtr(argv[1]);
   964    964     sqlite3BtreeEnter(pCur->pBtree);
   965    965     rc = sqlite3BtreeEof(pCur);
   966    966     sqlite3BtreeLeave(pCur->pBtree);
   967    967     sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", rc);
   968    968     Tcl_AppendResult(interp, zBuf, 0);
   969    969     return SQLITE_OK;
   970    970   }
................................................................................
   986    986     char zBuf[50];
   987    987   
   988    988     if( argc!=2 ){
   989    989       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   990    990          " ID\"", 0);
   991    991       return TCL_ERROR;
   992    992     }
   993         -  pCur = sqlite3TextToPtr(argv[1]);
          993  +  pCur = sqlite3TestTextToPtr(argv[1]);
   994    994     sqlite3BtreeEnter(pCur->pBtree);
   995    995     sqlite3BtreeKeySize(pCur, (i64*)&n);
   996    996     sqlite3BtreeLeave(pCur->pBtree);
   997    997     sqlite3_snprintf(sizeof(zBuf),zBuf, "%llu", n);
   998    998     Tcl_AppendResult(interp, zBuf, 0);
   999    999     return SQLITE_OK;
  1000   1000   }
................................................................................
  1016   1016     char *zBuf;
  1017   1017   
  1018   1018     if( argc!=2 ){
  1019   1019       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1020   1020          " ID\"", 0);
  1021   1021       return TCL_ERROR;
  1022   1022     }
  1023         -  pCur = sqlite3TextToPtr(argv[1]);
         1023  +  pCur = sqlite3TestTextToPtr(argv[1]);
  1024   1024     sqlite3BtreeEnter(pCur->pBtree);
  1025   1025     sqlite3BtreeKeySize(pCur, (i64*)&n);
  1026   1026     if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
  1027   1027       char zBuf2[60];
  1028   1028       sqlite3_snprintf(sizeof(zBuf2),zBuf2, "%llu", n);
  1029   1029       Tcl_AppendResult(interp, zBuf2, 0);
  1030   1030     }else{
................................................................................
  1060   1060     char *zBuf;
  1061   1061   
  1062   1062     if( argc!=2 && argc!=3 ){
  1063   1063       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1064   1064          " ID\"", 0);
  1065   1065       return TCL_ERROR;
  1066   1066     }
  1067         -  pCur = sqlite3TextToPtr(argv[1]);
         1067  +  pCur = sqlite3TestTextToPtr(argv[1]);
  1068   1068     sqlite3BtreeEnter(pCur->pBtree);
  1069   1069     if( argc==2 ){
  1070   1070       sqlite3BtreeDataSize(pCur, &n);
  1071   1071     }else{
  1072   1072       n = atoi(argv[2]);
  1073   1073     }
  1074   1074     zBuf = sqlite3_malloc( n+1 );
................................................................................
  1105   1105     char zStatic[1000];
  1106   1106   
  1107   1107     if( argc!=3 ){
  1108   1108       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1109   1109          " ID AMT\"", 0);
  1110   1110       return TCL_ERROR;
  1111   1111     }
  1112         -  pCur = sqlite3TextToPtr(argv[1]);
         1112  +  pCur = sqlite3TestTextToPtr(argv[1]);
  1113   1113     if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
  1114   1114     sqlite3BtreeEnter(pCur->pBtree);
  1115   1115     sqlite3BtreeKeySize(pCur, (i64*)&nKey);
  1116   1116     zBuf = sqlite3BtreeKeyFetch(pCur, &amt);
  1117   1117     if( zBuf && amt>=n ){
  1118   1118       assert( nKey<sizeof(zStatic) );
  1119   1119       if( n>0 ) nKey = n;
................................................................................
  1145   1145     char zStatic[1000];
  1146   1146   
  1147   1147     if( argc!=3 ){
  1148   1148       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1149   1149          " ID AMT\"", 0);
  1150   1150       return TCL_ERROR;
  1151   1151     }
  1152         -  pCur = sqlite3TextToPtr(argv[1]);
         1152  +  pCur = sqlite3TestTextToPtr(argv[1]);
  1153   1153     if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;
  1154   1154     sqlite3BtreeEnter(pCur->pBtree);
  1155   1155     sqlite3BtreeDataSize(pCur, &nData);
  1156   1156     zBuf = sqlite3BtreeDataFetch(pCur, &amt);
  1157   1157     if( zBuf && amt>=n ){
  1158   1158       assert( nData<sizeof(zStatic) );
  1159   1159       if( n>0 ) nData = n;
................................................................................
  1182   1182     char zBuf[50];
  1183   1183   
  1184   1184     if( argc!=2 ){
  1185   1185       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1186   1186          " ID\"", 0);
  1187   1187       return TCL_ERROR;
  1188   1188     }
  1189         -  pCur = sqlite3TextToPtr(argv[1]);
         1189  +  pCur = sqlite3TestTextToPtr(argv[1]);
  1190   1190     sqlite3BtreeEnter(pCur->pBtree);
  1191   1191     if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
  1192   1192       n1 = 0;
  1193   1193     }else{
  1194   1194       sqlite3BtreeKeySize(pCur, (i64*)&n1);
  1195   1195     }
  1196   1196     sqlite3BtreeDataSize(pCur, (u32*)&n2);
................................................................................
  1232   1232     char zBuf[400];
  1233   1233   
  1234   1234     if( argc!=2 && argc!=3 ){
  1235   1235       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1236   1236          " ID ?UP-CNT?\"", 0);
  1237   1237       return TCL_ERROR;
  1238   1238     }
  1239         -  pCur = sqlite3TextToPtr(argv[1]);
         1239  +  pCur = sqlite3TestTextToPtr(argv[1]);
  1240   1240     if( argc==3 ){
  1241   1241       if( Tcl_GetInt(interp, argv[2], &up) ) return TCL_ERROR;
  1242   1242     }else{
  1243   1243       up = 0;
  1244   1244     }
  1245   1245     sqlite3BtreeEnter(pCur->pBtree);
  1246   1246     rc = sqlite3BtreeCursorInfo(pCur, aResult, up);
................................................................................
  1292   1292     Tcl_DString str;
  1293   1293   
  1294   1294     if( argc!=3 ){
  1295   1295       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], 
  1296   1296                       " BTREE CURSOR", 0);
  1297   1297       return TCL_ERROR;
  1298   1298     }
  1299         -  pBt = sqlite3TextToPtr(argv[1]);
  1300         -  pCur = sqlite3TextToPtr(argv[2]);
         1299  +  pBt = sqlite3TestTextToPtr(argv[1]);
         1300  +  pCur = sqlite3TestTextToPtr(argv[2]);
  1301   1301     if( (*(void**)pCur) != (void*)pBt ){
  1302   1302       Tcl_AppendResult(interp, "Cursor ", argv[2], " does not belong to btree ",
  1303   1303          argv[1], 0);
  1304   1304       return TCL_ERROR;
  1305   1305     }
  1306   1306     sqlite3BtreeEnter(pBt);
  1307   1307     pPager = sqlite3BtreePager(pBt);
................................................................................
  1497   1497     Btree *pBt;
  1498   1498   
  1499   1499     if( argc!=3 ){
  1500   1500       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1501   1501          " BT NCACHE\"", 0);
  1502   1502       return TCL_ERROR;
  1503   1503     }
  1504         -  pBt = sqlite3TextToPtr(argv[1]);
         1504  +  pBt = sqlite3TestTextToPtr(argv[1]);
  1505   1505     if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
  1506   1506   
  1507   1507     sqlite3_mutex_enter(pBt->db->mutex);
  1508   1508     sqlite3BtreeEnter(pBt);
  1509   1509     sqlite3BtreeSetCacheSize(pBt, nCache);
  1510   1510     sqlite3BtreeLeave(pBt);
  1511   1511     sqlite3_mutex_leave(pBt->db->mutex);
................................................................................
  1528   1528     int res;
  1529   1529   
  1530   1530     if( argc!=2 ){
  1531   1531       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
  1532   1532          " ID\"", 0);
  1533   1533       return TCL_ERROR;
  1534   1534     }
  1535         -  pBt = sqlite3TextToPtr(argv[1]);
         1535  +  pBt = sqlite3TestTextToPtr(argv[1]);
  1536   1536     sqlite3_mutex_enter(pBt->db->mutex);
  1537   1537     sqlite3BtreeEnter(pBt);
  1538   1538     res = sqlite3PagerIsMemdb(sqlite3BtreePager(pBt));
  1539   1539     sqlite3BtreeLeave(pBt);
  1540   1540     sqlite3_mutex_leave(pBt->db->mutex);
  1541   1541     Tcl_SetObjResult(interp, Tcl_NewBooleanObj(res));
  1542   1542     return SQLITE_OK;
................................................................................
  1543   1543   }
  1544   1544   
  1545   1545   
  1546   1546   /*
  1547   1547   ** Register commands with the TCL interpreter.
  1548   1548   */
  1549   1549   int Sqlitetest3_Init(Tcl_Interp *interp){
  1550         -  extern int sqlite3BtreeTrace;
  1551   1550     static struct {
  1552   1551        char *zName;
  1553   1552        Tcl_CmdProc *xProc;
  1554   1553     } aCmd[] = {
  1555   1554        { "btree_open",               (Tcl_CmdProc*)btree_open               },
  1556   1555        { "btree_close",              (Tcl_CmdProc*)btree_close              },
  1557   1556        { "btree_begin_transaction",  (Tcl_CmdProc*)btree_begin_transaction  },
................................................................................
  1592   1591        { "btree_ismemdb",            (Tcl_CmdProc*)btree_ismemdb            },
  1593   1592     };
  1594   1593     int i;
  1595   1594   
  1596   1595     for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
  1597   1596       Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
  1598   1597     }
  1599         -  Tcl_LinkVar(interp, "btree_trace", (char*)&sqlite3BtreeTrace,
  1600         -     TCL_LINK_INT);
  1601   1598   
  1602   1599     /* The btree_insert command is implemented using the tcl 'object'
  1603   1600     ** interface, not the string interface like the other commands in this
  1604   1601     ** file. This is so binary data can be inserted into btree tables.
  1605   1602     */
  1606   1603     Tcl_CreateObjCommand(interp, "btree_insert", btree_insert, 0, 0);
  1607   1604     return TCL_OK;
  1608   1605   }

Changes to src/where.c.

    12     12   ** This module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.  This module is responsible for
    14     14   ** generating the code that loops through a table looking for applicable
    15     15   ** rows.  Indices are selected and used to speed the search when doing
    16     16   ** so is applicable.  Because this module is responsible for selecting
    17     17   ** indices, you might also think of this module as the "query optimizer".
    18     18   **
    19         -** $Id: where.c,v 1.316 2008/07/11 16:15:18 drh Exp $
           19  +** $Id: where.c,v 1.317 2008/07/12 14:52:20 drh Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   
    23     23   /*
    24     24   ** The number of bits in a Bitmask.  "BMS" means "BitMask Size".
    25     25   */
    26     26   #define BMS  (sizeof(Bitmask)*8)
    27     27   
    28     28   /*
    29     29   ** Trace output macros
    30     30   */
    31     31   #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
    32     32   int sqlite3WhereTrace = 0;
           33  +#endif
           34  +#if 0
    33     35   # define WHERETRACE(X)  if(sqlite3WhereTrace) sqlite3DebugPrintf X
    34     36   #else
    35     37   # define WHERETRACE(X)
    36     38   #endif
    37     39   
    38     40   /* Forward reference
    39     41   */

Changes to test/attach.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing the ATTACH and DETACH commands
    13     13   # and related functionality.
    14     14   #
    15         -# $Id: attach.test,v 1.48 2008/02/06 14:11:35 drh Exp $
           15  +# $Id: attach.test,v 1.49 2008/07/12 14:52:20 drh Exp $
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   ifcapable !attach {
    22     22     finish_test
................................................................................
    24     24   }
    25     25   
    26     26   for {set i 2} {$i<=15} {incr i} {
    27     27     file delete -force test$i.db
    28     28     file delete -force test$i.db-journal
    29     29   }
    30     30   
    31         -set btree_trace 0
    32     31   do_test attach-1.1 {
    33     32     execsql {
    34     33       CREATE TABLE t1(a,b);
    35     34       INSERT INTO t1 VALUES(1,2);
    36     35       INSERT INTO t1 VALUES(3,4);
    37     36       SELECT * FROM t1;
    38     37     }
................................................................................
    54     53   } {1 x 2 y}
    55     54   do_test attach-1.4 {
    56     55     execsql {
    57     56       SELECT * FROM t2;
    58     57     }
    59     58   } {1 x 2 y}
    60     59   do_test attach-1.5 {
    61         -btree_breakpoint
    62     60     execsql {
    63     61       DETACH DATABASE two;
    64     62       SELECT * FROM t1;
    65     63     }
    66     64   } {1 2 3 4}
    67     65   do_test attach-1.6 {
    68     66     catchsql {
................................................................................
   404    402     } db2;
   405    403   } {0 {21 x 22 y}}
   406    404   
   407    405   # Reading from test2.db from db within a transaction should not
   408    406   # prevent test2.db from being read by db2.
   409    407   do_test attach-3.5 {
   410    408     execsql {SELECT * FROM t2}
   411         -btree_breakpoint
   412    409     catchsql {
   413    410       SELECT * FROM t2;
   414    411     } db2;
   415    412   } {0 {21 x 22 y}}
   416    413   
   417    414   # Making a change to test2.db through db  causes test2.db to get
   418    415   # a reserved lock.  It should still be accessible through db2.
................................................................................
   473    470     catchsql {SELECT * FROM t1}
   474    471   } {0 {1 2 3 4}}
   475    472   do_test attach-3.15 {
   476    473     execsql COMMIT db2
   477    474     execsql {SELECT * FROM t1}
   478    475   } {1 2 3 4}
   479    476   
   480         -#set btree_trace 1
   481         -
   482    477   # Ticket #323
   483    478   do_test attach-4.1 {
   484    479     execsql {DETACH db2}
   485    480     db2 close
   486    481     sqlite3 db2 test2.db
   487    482     execsql {
   488    483       CREATE TABLE t3(x,y);

Changes to test/autovacuum_ioerr2.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing for correct handling of I/O errors
    13     13   # such as writes failing because the disk is full.
    14     14   # 
    15     15   # The tests in this file use special facilities that are only
    16     16   # available in the SQLite test fixture.
    17     17   #
    18         -# $Id: autovacuum_ioerr2.test,v 1.6 2007/04/28 15:47:44 danielk1977 Exp $
           18  +# $Id: autovacuum_ioerr2.test,v 1.7 2008/07/12 14:52:20 drh Exp $
    19     19   
    20     20   set testdir [file dirname $argv0]
    21     21   source $testdir/tester.tcl
    22     22   
    23     23   # If this build of the library does not support auto-vacuum, omit this
    24     24   # whole file.
    25     25   ifcapable {!autovacuum} {
................................................................................
   126    126     DELETE FROM abc;
   127    127     INSERT INTO abc VALUES(randstr(1500,1500));
   128    128     CREATE TABLE abc3(a);
   129    129     COMMIT;
   130    130   }
   131    131   
   132    132   finish_test
   133         -

Changes to test/collate3.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is page cache subsystem.
    13     13   #
    14         -# $Id: collate3.test,v 1.11 2005/09/08 01:58:43 drh Exp $
           14  +# $Id: collate3.test,v 1.12 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   #
    20     20   # Tests are organised as follows:
    21     21   #
................................................................................
   148    148     } {1 {no such collation sequence: string_compare}} 
   149    149     do_test collate3-2.12 {
   150    150       catchsql {
   151    151         SELECT c1 FROM collate3t1 UNION ALL SELECT c1 FROM collate3t1;
   152    152       }
   153    153     } {0 {}}
   154    154     do_test collate3-2.13 {
   155         -btree_breakpoint
   156    155       catchsql {
   157    156         SELECT 10 UNION ALL SELECT 20 ORDER BY 1 COLLATE string_compare;
   158    157       }
   159    158     } {1 {no such collation sequence: string_compare}} 
   160    159     do_test collate3-2.14 {
   161    160       catchsql {
   162    161         SELECT 10 INTERSECT SELECT 20 ORDER BY 1 COLLATE string_compare;

Changes to test/collate7.test.

     9      9   #    May you share freely, never taking more than you give.
    10     10   #
    11     11   #***********************************************************************
    12     12   # This file implements regression tests for SQLite library.  The
    13     13   # focus of this script is the experimental sqlite3_create_collation_v2()
    14     14   # API.
    15     15   #
    16         -# $Id: collate7.test,v 1.1 2007/05/07 14:58:53 danielk1977 Exp $
           16  +# $Id: collate7.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   set ::caseless_del 0
    22     22   proc caseless_cmp {zLeft zRight} {
    23     23     string compare -nocase $zLeft $zRight
................................................................................
    66     66   do_test collate7-2.4 {
    67     67     catchsql {
    68     68       SELECT * FROM abc16 WHERE a < 'abc';
    69     69     }
    70     70   } {1 {no such collation sequence: CASELESS}}
    71     71   
    72     72   finish_test
    73         -

Changes to test/crash3.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file contains tests that verify that SQLite can correctly rollback
    13     13   # databases after crashes when using the special IO modes triggered 
    14     14   # by device IOCAP flags.
    15     15   #
    16         -# $Id: crash3.test,v 1.3 2007/08/24 11:52:29 danielk1977 Exp $
           16  +# $Id: crash3.test,v 1.4 2008/07/12 14:52:20 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   ifcapable !crashtest {
    22     22     finish_test
    23     23     return
................................................................................
   184    184     sqlite3 db test.db
   185    185     do_test crash3-3.$ii {
   186    186       execsql {PRAGMA integrity_check}
   187    187     } {ok}
   188    188   }
   189    189   
   190    190   finish_test
   191         -

Changes to test/crash5.test.

     9      9   #    May you share freely, never taking more than you give.
    10     10   #
    11     11   #***********************************************************************
    12     12   # 
    13     13   # This file tests aspects of recovery from a malloc() failure
    14     14   # in a CREATE INDEX statement.
    15     15   #
    16         -# $Id: crash5.test,v 1.2 2008/01/18 14:17:21 danielk1977 Exp $
           16  +# $Id: crash5.test,v 1.3 2008/07/12 14:52:20 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   # Only run these tests if memory debugging is turned on.
    22     22   #
    23     23   ifcapable !memdebug||!crashtest||!memorymanage {
................................................................................
   104    104       } [list 1111111111 2222222222 $::c]
   105    105       db close
   106    106     }
   107    107   }
   108    108   
   109    109   
   110    110   finish_test
   111         -

Changes to test/diskfull.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing for correct handling of disk full
    13     13   # errors.
    14     14   # 
    15         -# $Id: diskfull.test,v 1.7 2007/08/24 03:51:34 drh Exp $
           15  +# $Id: diskfull.test,v 1.8 2008/07/12 14:52:20 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   set sqlite_io_error_persist 0
    21     21   set sqlite_io_error_hit 0
    22     22   set sqlite_io_error_pending 0
................................................................................
   100    100   #     INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3;
   101    101   #     UPDATE t3 
   102    102   #     SET b = (SELECT a FROM t3 WHERE rowid = (SELECT max(rowid)-1 FROM t3))
   103    103   #     WHERE rowid = (SELECT max(rowid) FROM t3);
   104    104   #     PRAGMA cache_size;
   105    105   #   }
   106    106   # } {10}
   107         -# breakpoint
          107  +# 
   108    108   # do_diskfull_test diskfull-3.2 {
   109    109   #   BEGIN;
   110    110   #     INSERT INTO t3 VALUES( randstr(100, 100), randstr(100, 100) );
   111    111   #     UPDATE t3 SET a = b;
   112    112   #   COMMIT;
   113    113   # }
   114    114   
   115    115   finish_test

Changes to test/icu.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: icu.test,v 1.1 2007/05/07 11:53:14 danielk1977 Exp $
           12  +# $Id: icu.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   
    18     18   ifcapable !icu {
    19     19     finish_test
................................................................................
   111    111   do_test icu-4.3 {
   112    112     execsql {
   113    113       SELECT name FROM fruit ORDER BY name COLLATE Lithuanian ASC;
   114    114     }
   115    115   } {apricot cherry chokecherry yamot peach plum}
   116    116   
   117    117   finish_test
   118         -

Changes to test/in2.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file tests a special case in the b-tree code that can be
    12     12   # hit by the "IN" operator (or EXISTS, NOT IN, etc.).
    13     13   #
    14         -# $Id: in2.test,v 1.2 2007/05/12 10:41:48 danielk1977 Exp $
           14  +# $Id: in2.test,v 1.3 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   do_test in2-1 {
    20     20     execsql {
    21     21       CREATE TABLE a(i INTEGER PRIMARY KEY, a);
................................................................................
    61     61       execsql {
    62     62         SELECT 1 IN (SELECT a FROM a WHERE (i < $::ii) OR (i >= $::N))
    63     63       }
    64     64     } {1}
    65     65   }
    66     66   
    67     67   finish_test
    68         -

Changes to test/incrvacuum_ioerr.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing for correct handling of I/O errors
    13     13   # such as writes failing because the disk is full.
    14     14   # 
    15     15   # The tests in this file use special facilities that are only
    16     16   # available in the SQLite test fixture.
    17     17   #
    18         -# $Id: incrvacuum_ioerr.test,v 1.5 2008/05/09 18:03:28 danielk1977 Exp $
           18  +# $Id: incrvacuum_ioerr.test,v 1.6 2008/07/12 14:52:20 drh Exp $
    19     19   
    20     20   set testdir [file dirname $argv0]
    21     21   source $testdir/tester.tcl
    22     22   
    23     23   # If this build of the library does not support auto-vacuum, omit this
    24     24   # whole file.
    25     25   ifcapable {!autovacuum} {
................................................................................
   175    175     #
   176    176     db1 close
   177    177     db2 close
   178    178     sqlite3_enable_shared_cache $::enable_shared_cache
   179    179   }
   180    180   
   181    181   finish_test
   182         -

Changes to test/ioerr.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing for correct handling of I/O errors
    13     13   # such as writes failing because the disk is full.
    14     14   # 
    15     15   # The tests in this file use special facilities that are only
    16     16   # available in the SQLite test fixture.
    17     17   #
    18         -# $Id: ioerr.test,v 1.40 2008/07/09 11:49:48 danielk1977 Exp $
           18  +# $Id: ioerr.test,v 1.41 2008/07/12 14:52:20 drh Exp $
    19     19   
    20     20   set testdir [file dirname $argv0]
    21     21   source $testdir/tester.tcl
    22     22   
    23     23   # If SQLITE_DEFAULT_AUTOVACUUM is set to true, then a simulated IO error
    24     24   # on the 8th IO operation in the SQL script below doesn't report an error.
    25     25   #
................................................................................
   401    401     INSERT INTO t1 VALUES(randomblob(100));
   402    402     INSERT INTO t1 VALUES(randomblob(100));
   403    403     INSERT INTO t1 VALUES(randomblob(100));
   404    404     COMMIT;
   405    405   }
   406    406   
   407    407   finish_test
   408         -

Changes to test/ioerr5.test.

    10     10   #***********************************************************************
    11     11   #
    12     12   # This file tests that if sqlite3_release_memory() is called to reclaim
    13     13   # memory from a pager that is in the error-state, SQLite does not 
    14     14   # incorrectly write dirty pages out to the database (not safe to do
    15     15   # once the pager is in error state).
    16     16   #
    17         -# $Id: ioerr5.test,v 1.3 2008/05/15 11:08:08 danielk1977 Exp $
           17  +# $Id: ioerr5.test,v 1.4 2008/07/12 14:52:20 drh Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   ifcapable !memorymanage||!shared_cache {
    23     23     finish_test
    24     24     return
................................................................................
   201    201     set sqlite_open_file_count
   202    202   } 0
   203    203   
   204    204   sqlite3_enable_shared_cache $::enable_shared_cache
   205    205   sqlite3_soft_heap_limit $::soft_limit
   206    206   
   207    207   finish_test
   208         -

Changes to test/lock5.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is database locks.
    13     13   #
    14         -# $Id: lock5.test,v 1.1 2008/06/28 11:23:00 danielk1977 Exp $
           14  +# $Id: lock5.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # This file is only run if using the unix backend compiled with the
    20     20   # SQLITE_ENABLE_LOCKING_STYLE macro.
    21     21   db close
................................................................................
   171    171   
   172    172   do_test lock5-flock.X {
   173    173     db close
   174    174     db2 close
   175    175   } {}
   176    176   
   177    177   finish_test
   178         -

Changes to test/main.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is exercising the code in main.c.
    13     13   #
    14         -# $Id: main.test,v 1.28 2008/01/22 23:37:10 drh Exp $
           14  +# $Id: main.test,v 1.29 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Only do the next group of tests if the sqlite3_complete API is available
    20     20   #
    21     21   ifcapable {complete} {
................................................................................
   333    333   }
   334    334   do_test main-3.2.12 {
   335    335     catchsql {select $testnamespace::xyz}
   336    336   } {0 321}
   337    337   do_test main-3.2.13 {
   338    338     catchsql {select $(abc)}
   339    339   } {1 {unrecognized token: "$"}}
   340         -breakpoint
   341    340   do_test main-3.2.14 {
   342    341     set hi\u1234x 987
   343    342     db eval "select \$hi\u1234x"
   344    343   } {987}
   345    344   do_test main-3.2.15 {
   346    345     catchsql "select 456\u1234"
   347    346   } [list 1 "unrecognized token: \"456\u1234\""]

Changes to test/memsubsys1.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file contains tests of the memory allocation subsystem
    13     13   #
    14         -# $Id: memsubsys1.test,v 1.3 2008/06/20 00:03:22 drh Exp $
           14  +# $Id: memsubsys1.test,v 1.4 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   sqlite3_reset_auto_extension
    19     19   
    20     20   # This procedure constructs a new database in test.db.  It fills
    21     21   # this database with many small records (enough to force multiple
................................................................................
   192    192   # that maximum allocation size is small.
   193    193   #
   194    194   db close
   195    195   sqlite3_shutdown
   196    196   sqlite3_config_pagecache 4096 24
   197    197   sqlite3_config_scratch 25000 1
   198    198   sqlite3_initialize
   199         -breakpoint
   200    199   build_test_db memsubsys1-7 {
   201    200     PRAGMA page_size=4096;
   202    201     PRAGMA cache_size=10;
   203    202     PRAGMA temp_cache_size=10;
   204    203   }
   205    204   #show_memstats
   206    205   do_test memsubsys1-7.3 {

Changes to test/minmax3.test.

     4      4   # a legal notice, here is a blessing:
     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11         -# $Id: minmax3.test,v 1.4 2008/03/28 19:16:57 danielk1977 Exp $
           11  +# $Id: minmax3.test,v 1.5 2008/07/12 14:52:20 drh Exp $
    12     12   
    13     13   set testdir [file dirname $argv0]
    14     14   source $testdir/tester.tcl
    15     15   
    16     16   # Do an SQL statement.  Append the search count to the end of the result.
    17     17   #
    18     18   proc count sql {
................................................................................
   211    211     execsql { SELECT min(b) FROM t2 WHERE a = 1 AND b<1; }
   212    212   } {{}}
   213    213   do_test minmax3-2.8 {
   214    214     execsql { SELECT min(b) FROM t2 WHERE a = 3 AND b<1; }
   215    215   } {{}}
   216    216   
   217    217   finish_test
   218         -

Changes to test/pragma.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests for the PRAGMA command.
    14     14   #
    15         -# $Id: pragma.test,v 1.63 2008/07/08 07:35:52 danielk1977 Exp $
           15  +# $Id: pragma.test,v 1.64 2008/07/12 14:52:20 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Test organization:
    21     21   #
    22     22   # pragma-1.*: Test cache_size, default_cache_size and synchronous on main db.
................................................................................
   958    958   } {2}
   959    959   do_test pragma-9.14 {
   960    960     execsql {
   961    961       PRAGMA temp_store = 3;
   962    962       PRAGMA temp_store;
   963    963     }
   964    964   } {0}
   965         -breakpoint
   966    965   do_test pragma-9.15 {
   967    966     catchsql {
   968    967       BEGIN EXCLUSIVE;
   969    968       CREATE TEMP TABLE temp_table(t);
   970    969       INSERT INTO temp_table VALUES('valuable data');
   971    970       PRAGMA temp_store = 1;
   972    971     }

Changes to test/ptrchng.test.

    17     17   #
    18     18   #     sqlite3_value_text()
    19     19   #     sqlite3_value_text16()
    20     20   #     sqlite3_value_blob()
    21     21   #     sqlite3_value_bytes()
    22     22   #     sqlite3_value_bytes16()
    23     23   #
    24         -# $Id: ptrchng.test,v 1.4 2008/02/14 05:44:45 danielk1977 Exp $
           24  +# $Id: ptrchng.test,v 1.5 2008/07/12 14:52:20 drh Exp $
    25     25   
    26     26   set testdir [file dirname $argv0]
    27     27   source $testdir/tester.tcl
    28     28   
    29     29   ifcapable !bloblit {
    30     30     finish_test
    31     31     return
................................................................................
   109    109     } {1}
   110    110     do_test ptrchng-2.15 {
   111    111       execsql {
   112    112         SELECT pointer_change(y, 'text16', 'noop', 'blob') FROM t1 WHERE x=3
   113    113       }
   114    114     } {0}
   115    115     do_test ptrchng-2.16 {
   116         -btree_breakpoint
   117    116       execsql {
   118    117         SELECT pointer_change(y, 'text16', 'noop', 'text') FROM t1 WHERE x=3
   119    118       }
   120    119     } {1}
   121    120   }
   122    121   
   123    122   # For the long entries that do not fit in the Mem.zBuf[], the pointer

Changes to test/reindex.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   # This file implements tests for the REINDEX command.
    13     13   #
    14         -# $Id: reindex.test,v 1.3 2005/01/27 00:22:04 danielk1977 Exp $
           14  +# $Id: reindex.test,v 1.4 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # There is nothing to test if REINDEX is disable for this build.
    20     20   #
    21     21   ifcapable {!reindex} {
................................................................................
   165    165   } {1 {no such collation sequence: c2}}
   166    166   
   167    167   do_test reindex-3.99 {
   168    168     db2 close
   169    169   } {}
   170    170   
   171    171   finish_test
   172         -

Changes to test/rtree.test.

     2      2   #    May you do good and not evil.
     3      3   #    May you find forgiveness for yourself and forgive others.
     4      4   #    May you share freely, never taking more than you give.
     5      5   #
     6      6   #***********************************************************************
     7      7   # This file runs all rtree related tests.
     8      8   #
     9         -# $Id: rtree.test,v 1.1 2008/06/23 15:55:52 danielk1977 Exp $
            9  +# $Id: rtree.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    10     10   
    11     11   set testdir [file dirname $argv0]
    12     12   source $testdir/tester.tcl
    13     13   
    14     14   rename finish_test rtree_finish_test
    15     15   proc finish_test {} {}
    16     16   
................................................................................
    34     34     }
    35     35   }
    36     36   
    37     37   set sqlite_open_file_count 0
    38     38   rtree_finish_test
    39     39   rename finish_test {}
    40     40   rename rtree_finish_test finish_test
    41         -

Changes to test/select2.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the SELECT statement.
    13     13   #
    14         -# $Id: select2.test,v 1.26 2008/04/24 12:38:29 danielk1977 Exp $
           14  +# $Id: select2.test,v 1.27 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Create a table with some data
    20     20   #
    21     21   execsql {CREATE TABLE tbl1(f1 int, f2 int)}
................................................................................
   114    114     execsql {SELECT f1 FROM tbl2 WHERE 1000=f2}
   115    115   } {500}
   116    116   do_test select2-3.2c {
   117    117     execsql {SELECT f1 FROM tbl2 WHERE f2=1000}
   118    118   } {500}
   119    119   do_test select2-3.2d {
   120    120     set sqlite_search_count 0
   121         -btree_breakpoint
   122    121     execsql {SELECT * FROM tbl2 WHERE 1000=f2}
   123    122     set sqlite_search_count
   124    123   } {3}
   125    124   do_test select2-3.2e {
   126    125     set sqlite_search_count 0
   127    126     execsql {SELECT * FROM tbl2 WHERE f2=1000}
   128    127     set sqlite_search_count

Changes to test/select6.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing SELECT statements that contain
    13     13   # subqueries in their FROM clause.
    14     14   #
    15         -# $Id: select6.test,v 1.26 2006/11/30 13:06:00 drh Exp $
           15  +# $Id: select6.test,v 1.27 2008/07/12 14:52:20 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Omit this whole file if the library is build without subquery support.
    21     21   ifcapable !subquery {
    22     22     finish_test
................................................................................
   190    190   do_test select6-3.6 {
   191    191     execsql {
   192    192       SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1)
   193    193       WHERE a>10
   194    194     }
   195    195   } {10.5 3.7 14.2}
   196    196   do_test select6-3.7 {
   197         -btree_breakpoint
   198    197     execsql {
   199    198       SELECT a,b,a+b FROM (SELECT avg(x) as 'a', avg(y) as 'b' FROM t1)
   200    199       WHERE a<10
   201    200     }
   202    201   } {}
   203    202   do_test select6-3.8 {
   204    203     execsql {

Changes to test/selectB.test.

     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. 
    12     12   #
    13         -# $Id: selectB.test,v 1.7 2008/07/10 17:59:12 danielk1977 Exp $
           13  +# $Id: selectB.test,v 1.8 2008/07/12 14:52:20 drh Exp $
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   
    18     18   proc test_transform {testname sql1 sql2 results} {
    19     19     set ::vdbe1 [list]
    20     20     set ::vdbe2 [list]
................................................................................
   368    368       execsql {
   369    369         SELECT * FROM (SELECT 345 UNION ALL SELECT d FROM t2) ORDER BY 1;
   370    370       }
   371    371     } {3 12 21 345}
   372    372   }
   373    373   
   374    374   finish_test
   375         -

Changes to test/shared.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: shared.test,v 1.33 2008/07/08 07:35:52 danielk1977 Exp $
           12  +# $Id: shared.test,v 1.34 2008/07/12 14:52:20 drh Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   db close
    17     17   
    18     18   # These tests cannot be run without the ATTACH command.
    19     19   #
................................................................................
   870    870     execsql {
   871    871       INSERT INTO abc2 VALUES(4, 5, 6);
   872    872       INSERT INTO abc2 VALUES(7, 8, 9);
   873    873     }
   874    874   } {}
   875    875   do_test shared-$av.11.8 {
   876    876     set res [list]
   877         -  breakpoint
   878    877     db2 eval {
   879    878       SELECT abc.a as I, abc2.a as II FROM abc, abc2;
   880    879     } {
   881    880       execsql {
   882    881         DELETE FROM abc WHERE 1;
   883    882       }
   884    883       lappend res $I $II

Changes to test/soak.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file is the driver for the "soak" tests. It is a peer of the
    12     12   # quick.test and all.test scripts.
    13     13   #
    14         -# $Id: soak.test,v 1.2 2007/05/30 10:36:47 danielk1977 Exp $
           14  +# $Id: soak.test,v 1.3 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   rename finish_test really_finish_test
    19     19   proc finish_test {} {}
    20     20   
    21     21   # By default, guarantee that the tests will run for at least 1 hour.
................................................................................
    83     83       lappend ::failList $tail
    84     84       set sqlite_open_file_count 0
    85     85     }
    86     86   
    87     87   }
    88     88   
    89     89   really_finish_test
    90         -

Changes to test/speed4.test.

    13     13   # the focus is on the speed of:
    14     14   #
    15     15   #   * joins
    16     16   #   * views
    17     17   #   * sub-selects
    18     18   #   * triggers
    19     19   #
    20         -# $Id: speed4.test,v 1.1 2007/10/23 10:25:30 danielk1977 Exp $
           20  +# $Id: speed4.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    21     21   #
    22     22   
    23     23   set testdir [file dirname $argv0]
    24     24   source $testdir/tester.tcl
    25     25   speed_trial_init speed1
    26     26   
    27     27   # Set a uniform random seed
................................................................................
   225    225     append sql "DELETE FROM t4 WHERE rowid = $ii;"
   226    226   }
   227    227   speed_trial speed4-notrigger3 10000 stmt $sql
   228    228   execsql {COMMIT}
   229    229   
   230    230   speed_trial_summary speed4
   231    231   finish_test
   232         -

Changes to test/tableapi.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the sqlite_exec_printf() and
    13     13   # sqlite_get_table_printf() APIs.
    14     14   #
    15         -# $Id: tableapi.test,v 1.18 2008/06/21 12:15:04 danielk1977 Exp $
           15  +# $Id: tableapi.test,v 1.19 2008/07/12 14:52:20 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   ifcapable memdebug {
    21     21     source $testdir/malloc_common.tcl
    22     22   }
................................................................................
    67     67   } {0 3 2 a b 48 (48) 49 (49) 50 (50)}
    68     68   do_test tableapi-2.3.3 {
    69     69     sqlite3_get_table_printf $::dbx {
    70     70       SELECT * FROM xyz WHERE a>47 ORDER BY a; invalid
    71     71     } {}
    72     72   } {1 {near "invalid": syntax error}}
    73     73   do_test tableapi-2.3.4 {
    74         -breakpoint
    75     74     sqlite3_get_table_printf $::dbx {
    76     75       SELECT * FROM xyz WHERE a>47 ORDER BY a
    77     76     } {} 8
    78     77   } {0 a b 48 (48) 49 (49) 50 (50)}
    79     78   do_test tableapi-2.4 {
    80     79     set manyquote ''''''''
    81     80     append manyquote $manyquote

Changes to test/thread001.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: thread001.test,v 1.4 2007/09/10 07:35:47 danielk1977 Exp $
           12  +# $Id: thread001.test,v 1.5 2008/07/12 14:52:20 drh Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   
    16     16   source $testdir/tester.tcl
    17     17   source $testdir/thread_common.tcl
    18     18   if {[info commands sqlthread] eq ""} {
    19     19     return
................................................................................
   132    132     } {1}
   133    133     do_test thread001.$tn.7 {
   134    134       execsql { PRAGMA integrity_check }
   135    135     } {ok}
   136    136   }
   137    137   
   138    138   finish_test
   139         -

Changes to test/thread002.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   #   This test attempts to deadlock SQLite in shared-cache mode.
    13     13   #     
    14     14   #
    15         -# $Id: thread002.test,v 1.2 2007/10/09 08:29:33 danielk1977 Exp $
           15  +# $Id: thread002.test,v 1.3 2008/07/12 14:52:20 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   
    19     19   source $testdir/tester.tcl
    20     20   source $testdir/thread_common.tcl
    21     21   if {[info commands sqlthread] eq ""} {
    22     22     finish_test
................................................................................
   103    103       ]
   104    104       db close
   105    105       set res
   106    106     } [list [expr 1 + $::NTHREAD*100] ok]
   107    107   }
   108    108   
   109    109   finish_test
   110         -

Changes to test/tkt1667.test.

    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests to verify that ticket #1667 has been
    14     14   # fixed.  
    15     15   #
    16     16   #
    17         -# $Id: tkt1667.test,v 1.2 2006/06/20 11:01:09 danielk1977 Exp $
           17  +# $Id: tkt1667.test,v 1.3 2008/07/12 14:52:20 drh Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   ifcapable !autovacuum||!tclvar {
    23     23     finish_test
    24     24     return
................................................................................
    77     77     execsql {
    78     78       DELETE FROM t1;
    79     79     }
    80     80   } {}
    81     81   integrity_check tkt1667-4.2
    82     82   
    83     83   finish_test
    84         -
    85         -

Changes to test/tkt2213.test.

    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests to verify that ticket #2213 has been
    14     14   # fixed.  
    15     15   #
    16     16   #
    17         -# $Id: tkt2213.test,v 1.1 2007/02/05 14:21:48 danielk1977 Exp $
           17  +# $Id: tkt2213.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   do_test tkt2213-1 {
    23     23     sqlite3_create_function db
    24     24     catchsql {
    25     25       SELECT tkt2213func(tkt2213func('abcd'));
    26     26     }
    27     27   } {0 abcd}
    28     28   
    29     29   finish_test
    30         -

Changes to test/tkt2285.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. Specifically.
    12     12   # it contains tests to verify that ticket #2285 has been fixed.  
    13     13   #
    14         -# $Id: tkt2285.test,v 1.1 2007/04/05 05:46:14 danielk1977 Exp $
           14  +# $Id: tkt2285.test,v 1.2 2008/07/12 14:52:20 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   ifcapable !tempdb {
    20     20     finish_test
    21     21     return
................................................................................
    50     50       execsql {
    51     51         SELECT * FROM sqlite_temp_master;
    52     52       }
    53     53     } {}
    54     54   }
    55     55   
    56     56   finish_test
    57         -

Changes to test/tkt2767.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file is to test that ticket #2767 has been fixed.
    13     13   # Ticket #2767 is for a VDBE stack overflow on BEFORE
    14     14   # triggers that run RAISE(IGNORE).
    15     15   #
    16         -# $Id: tkt2767.test,v 1.1 2007/11/11 18:36:35 drh Exp $
           16  +# $Id: tkt2767.test,v 1.2 2008/07/12 14:52:21 drh Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   do_test tkt2767-1.1 {
    23     23     execsql {

Changes to test/tkt2817.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # Specifically, it tests that bug 2817 is fixed.
    14     14   #
    15         -# $Id: tkt2817.test,v 1.1 2007/12/02 11:46:35 danielk1977 Exp $
           15  +# $Id: tkt2817.test,v 1.2 2008/07/12 14:52:21 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   do_test tkt2817-1.0 {
    21     21     execsql {
    22     22       CREATE TEMP TABLE tbl(a, b, c);
................................................................................
    66     66   } {}
    67     67   integrity_check tkt2817-2.2
    68     68   db close
    69     69   sqlite3 db test.db
    70     70   integrity_check tkt2817-2.3
    71     71   
    72     72   finish_test
    73         -

Changes to test/tkt2832.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file is to test that ticket #2832 has been fixed.
    13     13   #
    14         -# $Id: tkt2832.test,v 1.3 2007/12/12 18:05:21 danielk1977 Exp $
           14  +# $Id: tkt2832.test,v 1.4 2008/07/12 14:52:21 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   do_test tkt2832-1.1 {
    21     21     execsql {
................................................................................
    59     59     }
    60     60   } {}
    61     61   do_test tkt2832-3.2 {
    62     62     execsql { DELETE FROM t3 WHERE 1 }
    63     63   } {}
    64     64   
    65     65   finish_test
    66         -

Changes to test/tkt2854.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: tkt2854.test,v 1.2 2008/05/20 13:17:28 shane Exp $
           12  +# $Id: tkt2854.test,v 1.3 2008/07/12 14:52:21 drh Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   db close
    17     17   
    18     18   ifcapable !shared_cache {
    19     19     finish_test
................................................................................
   143    143   
   144    144   db close
   145    145   db2 close
   146    146   db3 close
   147    147   db4 close
   148    148   sqlite3_enable_shared_cache $::enable_shared_cache
   149    149   finish_test
   150         -

Changes to test/tkt2927.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file is to test that ticket #2927 is fixed.
    13     13   #
    14         -# $Id: tkt2927.test,v 1.2 2008/05/02 02:00:54 drh Exp $
           14  +# $Id: tkt2927.test,v 1.3 2008/07/12 14:52:21 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Create a database.
    21     21   #
................................................................................
    36     36     db eval {
    37     37       SELECT a, b FROM t1
    38     38       UNION ALL
    39     39       SELECT a, b FROM t1
    40     40     }
    41     41   } {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}
    42     42   do_test tkt2927-2.2 {
    43         -breakpoint
    44     43   #set sqlite_addop_trace 1
    45     44     db eval {
    46     45       SELECT a, b FROM t1
    47     46       UNION ALL
    48     47       SELECT a, abs(b) FROM t1
    49     48     }
    50     49   } {1 11 2 22 3 33 4 44 5 55 1 11 2 22 3 33 4 44 5 55}

Changes to test/tkt3121.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: tkt3121.test,v 1.1 2008/05/16 15:40:40 danielk1977 Exp $
           12  +# $Id: tkt3121.test,v 1.2 2008/07/12 14:52:21 drh Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   
    17     17   ifcapable !vtab {
    18     18     finish_test
    19     19     return
................................................................................
    44     44         t1.field as Field,
    45     45         t2.descr as Descr
    46     46       from t1 inner join t2 on t1.field = t2.col order by t1.field
    47     47     }
    48     48   } {abcd {A nice description}}
    49     49   
    50     50   finish_test
    51         -

Changes to test/tkt3201.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. 
    12     12   # Specifically, it tests that bug #3201 has been fixed.
    13     13   #
    14         -# $Id: tkt3201.test,v 1.2 2008/07/04 10:56:08 danielk1977 Exp $
           14  +# $Id: tkt3201.test,v 1.3 2008/07/12 14:52:21 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   do_test tkt3201-1 {
    20     20     execsql {
    21     21       CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
................................................................................
    68     68   
    69     69   do_test tkt3201-7 {
    70     70     execsql { SELECT a, b, c, d FROM t1, t3 WHERE a < c }
    71     71   } {1 one 2 two}
    72     72   
    73     73   
    74     74   finish_test
    75         -
    76         -

Changes to test/triggerB.test.

    31     31       BEGIN
    32     32         UPDATE x SET y = new.y WHERE x = new.x;
    33     33       END;
    34     34       SELECT * FROM vx;
    35     35     }
    36     36   } {1 1 0 2 1 0}
    37     37   do_test triggerB-1.2 {
    38         -breakpoint
    39     38     execsql {
    40     39       UPDATE vx SET y = yy;
    41     40       SELECT * FROM vx;
    42     41     }
    43     42   } {1 0 0 2 0 0}
    44     43   
    45     44   finish_test

Changes to test/vacuum3.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is changing the database page size using a 
    13     13   # VACUUM statement.
    14     14   #
    15         -# $Id: vacuum3.test,v 1.5 2008/06/03 07:34:09 danielk1977 Exp $
           15  +# $Id: vacuum3.test,v 1.6 2008/07/12 14:52:21 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # If the VACUUM statement is disabled in the current build, skip all
    21     21   # the tests in this file.
    22     22   #
................................................................................
    51     51     1024 1024 2048                        \
    52     52     1170 1024 2048                        \
    53     53     256  1024 2048                        \
    54     54     512  512  1024                        \
    55     55     4096 4096 8192                        \
    56     56     1024 1024 2048                        \
    57     57   ] {
    58         -if {$I==10} breakpoint
    59     58     do_test vacuum3-1.$I.1 {
    60     59       execsql " 
    61     60         PRAGMA page_size = $request;
    62     61         VACUUM;
    63     62       "
    64     63       execsql { PRAGMA page_size }
    65     64     } $actual
................................................................................
   101    100     1024 1024 3072                        \
   102    101     1170 1024 3072                        \
   103    102     256  1024 3072                        \
   104    103     512  512  2048                        \
   105    104     4096 4096 8192                        \
   106    105     1024 1024 3072                        \
   107    106   ] {
   108         -if {$I==10} breakpoint
   109    107     do_test vacuum3-2.$I.1 {
   110    108       execsql " 
   111    109         PRAGMA page_size = $request;
   112    110         VACUUM;
   113    111       "
   114    112       execsql { PRAGMA page_size }
   115    113     } $actual
................................................................................
   177    175     1024 1024                    \
   178    176     1170 1024                    \
   179    177     256  1024                    \
   180    178     512  512                     \
   181    179     4096 4096                    \
   182    180     1024 1024                    \
   183    181   ] {
   184         -if {$I==10} breakpoint
   185    182     do_test vacuum3-3.$I.1 {
   186    183       execsql " 
   187    184         PRAGMA page_size = $request;
   188    185         VACUUM;
   189    186       "
   190    187       execsql { PRAGMA page_size }
   191    188     } $actual

Changes to test/veryquick.test.

     4      4   #    May you share freely, never taking more than you give.
     5      5   #
     6      6   #***********************************************************************
     7      7   # This file runs all the tests run by quick.test except for those related
     8      8   # to malloc or IO error simulation. With these tests omitted, the overall
     9      9   # run time is reduced by about 75%.
    10     10   #
    11         -# $Id: veryquick.test,v 1.8 2008/06/25 17:54:55 danielk1977 Exp $
           11  +# $Id: veryquick.test,v 1.9 2008/07/12 14:52:21 drh Exp $
    12     12   
    13     13   set testdir [file dirname $argv0]
    14     14   set ISVERYQUICK 1
    15     15   source $testdir/quick.test
    16         -

Changes to test/vtab3.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is the authorisation callback and virtual tables.
    13     13   #
    14         -# $Id: vtab3.test,v 1.2 2006/06/20 11:01:09 danielk1977 Exp $
           14  +# $Id: vtab3.test,v 1.3 2008/07/12 14:52:21 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   ifcapable !vtab||!auth {
    20     20     finish_test
    21     21     return
................................................................................
   134    134   do_test vtab3-1.8.2 {
   135    135     execsql {
   136    136       SELECT name FROM sqlite_master WHERE type = 'table';
   137    137     }
   138    138   } {elephant}
   139    139   
   140    140   finish_test
   141         -
   142         -

Changes to test/vtab4.test.

    12     12   # focus is on testing the following virtual table methods:
    13     13   #
    14     14   #     xBegin
    15     15   #     xSync
    16     16   #     xCommit
    17     17   #     xRollback
    18     18   #
    19         -# $Id: vtab4.test,v 1.2 2006/09/02 22:14:59 drh Exp $
           19  +# $Id: vtab4.test,v 1.3 2008/07/12 14:52:21 drh Exp $
    20     20   
    21     21   set testdir [file dirname $argv0]
    22     22   source $testdir/tester.tcl
    23     23   
    24     24   unset -nocomplain echo_module
    25     25   unset -nocomplain echo_module_sync_fail
    26     26   
................................................................................
   164    164       INSERT INTO techo VALUES(1, 2, 3);
   165    165     }
   166    166   } {1 {unknown error}}
   167    167   do_test vtab4-3.2 {
   168    168     set echo_module
   169    169   } {xBegin echo(treal) xSync echo(treal) xRollback echo(treal)}
   170    170   
   171         -breakpoint
   172    171   do_test vtab4-3.3 {
   173    172     set echo_module [list]
   174    173     set echo_module_sync_fail sreal
   175    174     catchsql {
   176    175       BEGIN;
   177    176       INSERT INTO techo SELECT * FROM secho;
   178    177       DELETE FROM secho;

Changes to test/vtab5.test.

     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13         -# $Id: vtab5.test,v 1.7 2007/06/27 15:53:35 danielk1977 Exp $
           13  +# $Id: vtab5.test,v 1.8 2008/07/12 14:52:21 drh Exp $
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   
    18     18   ifcapable !vtab {
    19     19     finish_test
    20     20     return
................................................................................
   146    146   # do_test vtab5.4.3 {
   147    147   #   catchsql {
   148    148   #     ALTER TABLE echo_strings RENAME TO echo_strings2;
   149    149   #   }
   150    150   # } {1 {virtual tables may not be altered}}
   151    151   
   152    152   finish_test
   153         -

Changes to test/vtab6.test.

    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests for joins, including outer joins involving
    14     14   # virtual tables. The test cases in this file are copied from the file
    15     15   # join.test, and some of the comments still reflect that.
    16     16   #
    17         -# $Id: vtab6.test,v 1.3 2008/03/17 09:36:45 danielk1977 Exp $
           17  +# $Id: vtab6.test,v 1.4 2008/07/12 14:52:21 drh Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   ifcapable !vtab {
    23     23     finish_test
    24     24     return
................................................................................
   153    153   do_test vtab6-1.12 {
   154    154     execsql {
   155    155       SELECT * FROM t1 natural inner join t2;
   156    156     }
   157    157   } {1 2 3 4 2 3 4 5}
   158    158   
   159    159   ifcapable subquery {
   160         -breakpoint
   161    160     do_test vtab6-1.13 {
   162    161       execsql2 {
   163    162         SELECT * FROM t1 NATURAL JOIN 
   164    163           (SELECT b as 'c', c as 'd', d as 'e' FROM t2) as t3
   165    164       }
   166    165     } {a 1 b 2 c 3 d 4 e 5}
   167    166     do_test vtab6-1.14 {

Changes to test/vtabA.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is 'hidden' virtual table columns.
    13     13   #
    14         -# $Id: vtabA.test,v 1.1 2007/06/26 10:38:54 danielk1977 Exp $
           14  +# $Id: vtabA.test,v 1.2 2008/07/12 14:52:21 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   ifcapable !vtab {
    20     20     finish_test
    21     21     return
................................................................................
   128    128   } {{} {} {} {}}
   129    129   
   130    130   do_test vtabA-2.4 {
   131    131     analyse_parse {(a whatelse can i hidden test, b HIDDEN hidden)} {a b}
   132    132   } {{} {whatelse can i test} hidden}
   133    133   
   134    134   finish_test
   135         -

Changes to test/where.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the use of indices in WHERE clases.
    13     13   #
    14         -# $Id: where.test,v 1.44 2007/11/29 17:43:28 danielk1977 Exp $
           14  +# $Id: where.test,v 1.45 2008/07/12 14:52:21 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Build some test data
    20     20   #
    21     21   do_test where-1.0 {
................................................................................
  1081   1081     } 
  1082   1082   } {1/1 1/4 4/1 4/4 nosort}
  1083   1083   do_test where-14.4 {
  1084   1084     cksort {
  1085   1085       SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.a, x.b DESC
  1086   1086     } 
  1087   1087   } {1/1 1/4 4/1 4/4 nosort}
  1088         -btree_breakpoint
  1089   1088   do_test where-14.5 {
  1090   1089     cksort {
  1091   1090       SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b
  1092   1091     } 
  1093   1092   } {4/1 4/4 1/1 1/4 nosort}
  1094   1093   do_test where-14.6 {
  1095   1094     cksort {