/ Check-in [41e226d2]
Login

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

Overview
Comment:The sqlite3_query_plan debugging variable now only appears with SQLITE_TEST=1. (CVS 2721)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 41e226d2ff5c0021fd07388da13f6d750fac508b
User & Date: drh 2005-09-19 13:15:23
Context
2005-09-19
15:37
Fix uninitialized value on a UNION ALL select with an ORDER BY clause. (CVS 2722) check-in: 92126a21 user: drh tags: trunk
13:15
The sqlite3_query_plan debugging variable now only appears with SQLITE_TEST=1. (CVS 2721) check-in: 41e226d2 user: drh tags: trunk
12:53
Work around limitations of MSVC++ 6. Tickets #1429, #1437, and #1440. (CVS 2720) check-in: b2d1803c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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 the printf() interface to 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: test1.c,v 1.161 2005/09/19 12:37:28 drh Exp $
           16  +** $Id: test1.c,v 1.162 2005/09/19 13:15:23 drh Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include "os.h"
    21     21   #include <stdlib.h>
    22     22   #include <string.h>
    23     23   
................................................................................
  3176   3176     int i;
  3177   3177     extern int sqlite3_os_trace;
  3178   3178     extern int sqlite3_where_trace;
  3179   3179     extern int sqlite3_sync_count, sqlite3_fullsync_count;
  3180   3180     extern int sqlite3_opentemp_count;
  3181   3181     extern int sqlite3_memUsed;
  3182   3182     extern int sqlite3_memMax;
  3183         -  extern char sqlite3_query_plan[];
  3184   3183     extern int sqlite3_like_count;
  3185   3184   #if OS_WIN
  3186   3185     extern int sqlite3_os_type;
  3187   3186   #endif
  3188   3187   #ifdef SQLITE_DEBUG
  3189   3188     extern int sqlite3_vdbe_addop_trace;
         3189  +#endif
         3190  +#ifdef SQLITE_TEST
         3191  +  extern char sqlite3_query_plan[];
  3190   3192     static char *query_plan = sqlite3_query_plan;
  3191   3193   #endif
  3192   3194   
  3193   3195     for(i=0; i<sizeof(aCmd)/sizeof(aCmd[0]); i++){
  3194   3196       Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0);
  3195   3197     }
  3196   3198     for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
................................................................................
  3211   3213         (char*)&sqlite3_current_time, TCL_LINK_INT);
  3212   3214     Tcl_LinkVar(interp, "sqlite_os_trace",
  3213   3215         (char*)&sqlite3_os_trace, TCL_LINK_INT);
  3214   3216   #if OS_WIN
  3215   3217     Tcl_LinkVar(interp, "sqlite_os_type",
  3216   3218         (char*)&sqlite3_os_type, TCL_LINK_INT);
  3217   3219   #endif
         3220  +#ifdef SQLITE_TEST
         3221  +  Tcl_LinkVar(interp, "sqlite_query_plan",
         3222  +      (char*)&query_plan, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
         3223  +#endif
  3218   3224   #ifdef SQLITE_DEBUG
  3219   3225     Tcl_LinkVar(interp, "sqlite_addop_trace",
  3220   3226         (char*)&sqlite3_vdbe_addop_trace, TCL_LINK_INT);
  3221         -  Tcl_LinkVar(interp, "sqlite_query_plan",
  3222         -      (char*)&query_plan, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
  3223   3227     Tcl_LinkVar(interp, "sqlite_where_trace",
  3224   3228         (char*)&sqlite3_where_trace, TCL_LINK_INT);
  3225   3229   #endif
  3226   3230   #ifdef SQLITE_MEMDEBUG
  3227   3231     Tcl_LinkVar(interp, "sqlite_memused",
  3228   3232         (char*)&sqlite3_memUsed, TCL_LINK_INT | TCL_LINK_READ_ONLY);
  3229   3233     Tcl_LinkVar(interp, "sqlite_memmax",

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 reponsible 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.175 2005/09/19 12:37:28 drh Exp $
           19  +** $Id: where.c,v 1.176 2005/09/19 13:15:23 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)
................................................................................
  1260   1260     if( termsInMem ){
  1261   1261       for(j=0; j<nEq; j++){
  1262   1262         sqlite3VdbeAddOp(v, OP_MemLoad, pLevel->iMem+j+1, 0);
  1263   1263       }
  1264   1264     }
  1265   1265   }
  1266   1266   
  1267         -#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
         1267  +#if defined(SQLITE_TEST)
  1268   1268   /*
  1269   1269   ** The following variable holds a text description of query plan generated
  1270   1270   ** by the most recent call to sqlite3WhereBegin().  Each call to WhereBegin
  1271   1271   ** overwrites the previous.  This information is used for testing and
  1272   1272   ** analysis only.
  1273   1273   */
  1274   1274   char sqlite3_query_plan[BMS*2*40];  /* Text of the join */