/ Check-in [ae565ff3]
Login

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

Overview
Comment:New debugging pragmas: PRAGMA vdbe_debug=ON is short-hand for the sql_trace, vdbe_listing, and vdbe_trace pragmas. PRAGMA vdbe_debug enables tracing of sqlite3VdbeAddOp() calls. None of this is active unless compiled with SQLITE_DEBUG.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ae565ff3e0836b0cb45cc0ba7f27fa8cb2d21d77
User & Date: drh 2013-01-29 19:14:31
Context
2013-01-29
23:55
Fix LIMIT and OFFSET so that they work and do not leak memory even on complex queries involving deeply nested views of UNION ALL compounds. Ticket [db4d96798da8]. Secondary to ticket [d58ccbb3f1b7]. check-in: 497ee36c user: drh tags: trunk
19:14
New debugging pragmas: PRAGMA vdbe_debug=ON is short-hand for the sql_trace, vdbe_listing, and vdbe_trace pragmas. PRAGMA vdbe_debug enables tracing of sqlite3VdbeAddOp() calls. None of this is active unless compiled with SQLITE_DEBUG. check-in: ae565ff3 user: drh tags: trunk
2013-01-28
22:52
Fix an issue with the SQLITE_TESTCTRL_EXPLAIN_STMT and compound queries with multiple terms. check-in: a6499c25 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pragma.c.

   180    180   #ifndef SQLITE_OMIT_AUTOMATIC_INDEX
   181    181       { "automatic_index",          SQLITE_AutoIndex     },
   182    182   #endif
   183    183   #ifdef SQLITE_DEBUG
   184    184       { "sql_trace",                SQLITE_SqlTrace      },
   185    185       { "vdbe_listing",             SQLITE_VdbeListing   },
   186    186       { "vdbe_trace",               SQLITE_VdbeTrace     },
          187  +    { "vdbe_addoptrace",          SQLITE_VdbeAddopTrace},
          188  +    { "vdbe_debug",    SQLITE_SqlTrace | SQLITE_VdbeListing
          189  +                               | SQLITE_VdbeTrace      },
   187    190   #endif
   188    191   #ifndef SQLITE_OMIT_CHECK
   189    192       { "ignore_check_constraints", SQLITE_IgnoreChecks  },
   190    193   #endif
   191    194       /* The following is VERY experimental */
   192    195       { "writable_schema",          SQLITE_WriteSchema|SQLITE_RecoveryMode },
   193    196   

Changes to src/sqliteInt.h.

   945    945                                             /*   DELETE, or UPDATE and return */
   946    946                                             /*   the count using a callback. */
   947    947   #define SQLITE_NullCallback   0x00000020  /* Invoke the callback once if the */
   948    948                                             /*   result set is empty */
   949    949   #define SQLITE_SqlTrace       0x00000040  /* Debug print SQL as it executes */
   950    950   #define SQLITE_VdbeListing    0x00000080  /* Debug listings of VDBE programs */
   951    951   #define SQLITE_WriteSchema    0x00000100  /* OK to update SQLITE_MASTER */
   952         -                         /*   0x00000200  Unused */
          952  +#define SQLITE_VdbeAddopTrace 0x00000200  /* Trace sqlite3VdbeAddOp() calls */
   953    953   #define SQLITE_IgnoreChecks   0x00000400  /* Do not enforce check constraints */
   954    954   #define SQLITE_ReadUncommitted 0x0000800  /* For shared-cache mode */
   955    955   #define SQLITE_LegacyFileFmt  0x00001000  /* Create new databases in format 1 */
   956    956   #define SQLITE_FullFSync      0x00002000  /* Use full fsync on the backend */
   957    957   #define SQLITE_CkptFullFSync  0x00004000  /* Use full fsync for checkpoint */
   958    958   #define SQLITE_RecoveryMode   0x00008000  /* Ignore schema errors */
   959    959   #define SQLITE_ReverseOrder   0x00010000  /* Reverse unordered SELECTs */

Changes to src/test1.c.

  6295   6295         (char*)&sqlite3_os_type, TCL_LINK_INT);
  6296   6296   #endif
  6297   6297   #ifdef SQLITE_TEST
  6298   6298     Tcl_LinkVar(interp, "sqlite_query_plan",
  6299   6299         (char*)&query_plan, TCL_LINK_STRING|TCL_LINK_READ_ONLY);
  6300   6300   #endif
  6301   6301   #ifdef SQLITE_DEBUG
  6302         -  Tcl_LinkVar(interp, "sqlite_addop_trace",
  6303         -      (char*)&sqlite3VdbeAddopTrace, TCL_LINK_INT);
  6304   6302     Tcl_LinkVar(interp, "sqlite_where_trace",
  6305   6303         (char*)&sqlite3WhereTrace, TCL_LINK_INT);
  6306   6304     Tcl_LinkVar(interp, "sqlite_os_trace",
  6307   6305         (char*)&sqlite3OSTrace, TCL_LINK_INT);
  6308   6306   #ifndef SQLITE_OMIT_WAL
  6309   6307     Tcl_LinkVar(interp, "sqlite_wal_trace",
  6310   6308         (char*)&sqlite3WalTrace, TCL_LINK_INT);

Changes to src/vdbeaux.c.

    13     13   ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.)  Prior
    14     14   ** to version 2.8.7, all this code was combined into the vdbe.c source file.
    15     15   ** But that file was getting too big so this subroutines were split out.
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include "vdbeInt.h"
    19     19   
    20         -
    21         -
    22         -/*
    23         -** When debugging the code generator in a symbolic debugger, one can
    24         -** set the sqlite3VdbeAddopTrace to 1 and all opcodes will be printed
    25         -** as they are added to the instruction stream.
    26         -*/
    27         -#ifdef SQLITE_DEBUG
    28         -int sqlite3VdbeAddopTrace = 0;
    29         -#endif
    30         -
    31         -
    32     20   /*
    33     21   ** Create a new virtual database engine.
    34     22   */
    35     23   Vdbe *sqlite3VdbeCreate(sqlite3 *db){
    36     24     Vdbe *p;
    37     25     p = sqlite3DbMallocZero(db, sizeof(Vdbe) );
    38     26     if( p==0 ) return 0;
................................................................................
   154    142     pOp->p1 = p1;
   155    143     pOp->p2 = p2;
   156    144     pOp->p3 = p3;
   157    145     pOp->p4.p = 0;
   158    146     pOp->p4type = P4_NOTUSED;
   159    147   #ifdef SQLITE_DEBUG
   160    148     pOp->zComment = 0;
   161         -  if( sqlite3VdbeAddopTrace ) sqlite3VdbePrintOp(0, i, &p->aOp[i]);
          149  +  if( p->db->flags & SQLITE_VdbeAddopTrace ){
          150  +    sqlite3VdbePrintOp(0, i, &p->aOp[i]);
          151  +  }
   162    152   #endif
   163    153   #ifdef VDBE_PROFILE
   164    154     pOp->cycles = 0;
   165    155     pOp->cnt = 0;
   166    156   #endif
   167    157     return i;
   168    158   }
................................................................................
   508    498         }
   509    499         pOut->p3 = pIn->p3;
   510    500         pOut->p4type = P4_NOTUSED;
   511    501         pOut->p4.p = 0;
   512    502         pOut->p5 = 0;
   513    503   #ifdef SQLITE_DEBUG
   514    504         pOut->zComment = 0;
   515         -      if( sqlite3VdbeAddopTrace ){
          505  +      if( p->db->flags & SQLITE_VdbeAddopTrace ){
   516    506           sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
   517    507         }
   518    508   #endif
   519    509       }
   520    510       p->nOp += nOp;
   521    511     }
   522    512     return addr;