/ Check-in [0a5318bc]
Login

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

Overview
Comment:Attempt to work around MSVC's treatment of __LINE__ as a non-constant value in "Edit and Continue" mode by avoiding the use of __LINE__ when SQLITE_VDBE_COVERAGE is not defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0a5318bc272b844e937cb1df3a07224034bc3450
User & Date: drh 2014-03-10 18:03:09
Context
2014-03-10
20:12
Adjustments to the cost computation for the skip-scan query plan, to take into account the fact that a seek has to occur on each skip. check-in: 0769eebd user: drh tags: trunk
18:03
Attempt to work around MSVC's treatment of __LINE__ as a non-constant value in "Edit and Continue" mode by avoiding the use of __LINE__ when SQLITE_VDBE_COVERAGE is not defined. check-in: 0a5318bc user: drh tags: trunk
12:20
Version 3.8.4 check-in: 530a1ee7 user: drh tags: trunk, release, version-3.8.4
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pragma.c.

   820    820     ** Older versions of SQLite would set the default cache size to a
   821    821     ** negative number to indicate synchronous=OFF.  These days, synchronous
   822    822     ** is always on by default regardless of the sign of the default cache
   823    823     ** size.  But continue to take the absolute value of the default cache
   824    824     ** size of historical compatibility.
   825    825     */
   826    826     case PragTyp_DEFAULT_CACHE_SIZE: {
   827         -    static const int iLn = __LINE__+2;
          827  +    static const int iLn = VDBE_OFFSET_LINENO(2);
   828    828       static const VdbeOpList getCacheSize[] = {
   829    829         { OP_Transaction, 0, 0,        0},                         /* 0 */
   830    830         { OP_ReadCookie,  0, 1,        BTREE_DEFAULT_CACHE_SIZE},  /* 1 */
   831    831         { OP_IfPos,       1, 8,        0},
   832    832         { OP_Integer,     0, 2,        0},
   833    833         { OP_Subtract,    1, 2,        1},
   834    834         { OP_IfPos,       1, 8,        0},
................................................................................
  1083   1083         rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto);
  1084   1084         if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){
  1085   1085           /* When setting the auto_vacuum mode to either "full" or 
  1086   1086           ** "incremental", write the value of meta[6] in the database
  1087   1087           ** file. Before writing to meta[6], check that meta[3] indicates
  1088   1088           ** that this really is an auto-vacuum capable database.
  1089   1089           */
  1090         -        static const int iLn = __LINE__+2;
         1090  +        static const int iLn = VDBE_OFFSET_LINENO(2);
  1091   1091           static const VdbeOpList setMeta6[] = {
  1092   1092             { OP_Transaction,    0,         1,                 0},    /* 0 */
  1093   1093             { OP_ReadCookie,     0,         1,         BTREE_LARGEST_ROOT_PAGE},
  1094   1094             { OP_If,             1,         0,                 0},    /* 2 */
  1095   1095             { OP_Halt,           SQLITE_OK, OE_Abort,          0},    /* 3 */
  1096   1096             { OP_Integer,        0,         1,                 0},    /* 4 */
  1097   1097             { OP_SetCookie,      0,         BTREE_INCR_VACUUM, 1},    /* 5 */
................................................................................
  1786   1786     case PragTyp_INTEGRITY_CHECK: {
  1787   1787       int i, j, addr, mxErr;
  1788   1788   
  1789   1789       /* Code that appears at the end of the integrity check.  If no error
  1790   1790       ** messages have been generated, output OK.  Otherwise output the
  1791   1791       ** error message
  1792   1792       */
  1793         -    static const int iLn = __LINE__+2;
         1793  +    static const int iLn = VDBE_OFFSET_LINENO(2);
  1794   1794       static const VdbeOpList endCode[] = {
  1795   1795         { OP_AddImm,      1, 0,        0},    /* 0 */
  1796   1796         { OP_IfNeg,       1, 0,        0},    /* 1 */
  1797   1797         { OP_String8,     0, 3,        0},    /* 2 */
  1798   1798         { OP_ResultRow,   3, 1,        0},
  1799   1799       };
  1800   1800   

Changes to src/trigger.c.

   562    562   #endif
   563    563   
   564    564     /* Generate code to destroy the database record of the trigger.
   565    565     */
   566    566     assert( pTable!=0 );
   567    567     if( (v = sqlite3GetVdbe(pParse))!=0 ){
   568    568       int base;
   569         -    static const int iLn = __LINE__+2;
          569  +    static const int iLn = VDBE_OFFSET_LINENO(2);
   570    570       static const VdbeOpList dropTrigger[] = {
   571    571         { OP_Rewind,     0, ADDR(9),  0},
   572    572         { OP_String8,    0, 1,        0}, /* 1 */
   573    573         { OP_Column,     0, 1,        2},
   574    574         { OP_Ne,         2, ADDR(8),  1},
   575    575         { OP_String8,    0, 1,        0}, /* 4: "trigger" */
   576    576         { OP_Column,     0, 0,        2},

Changes to src/vdbe.h.

   268    268   */
   269    269   #ifdef SQLITE_VDBE_COVERAGE
   270    270     void sqlite3VdbeSetLineNumber(Vdbe*,int);
   271    271   # define VdbeCoverage(v) sqlite3VdbeSetLineNumber(v,__LINE__)
   272    272   # define VdbeCoverageIf(v,x) if(x)sqlite3VdbeSetLineNumber(v,__LINE__)
   273    273   # define VdbeCoverageAlwaysTaken(v) sqlite3VdbeSetLineNumber(v,2);
   274    274   # define VdbeCoverageNeverTaken(v) sqlite3VdbeSetLineNumber(v,1);
          275  +# define VDBE_OFFSET_LINENO(x) (__LINE__+x)
   275    276   #else
   276    277   # define VdbeCoverage(v)
   277    278   # define VdbeCoverageIf(v,x)
   278    279   # define VdbeCoverageAlwaysTaken(v)
   279    280   # define VdbeCoverageNeverTaken(v)
          281  +# define VDBE_OFFSET_LINENO(x) 0
   280    282   #endif
   281    283   
   282    284   #endif

Changes to src/vdbeblob.c.

   129    129     ** uses it to implement the blob_read(), blob_write() and 
   130    130     ** blob_bytes() functions.
   131    131     **
   132    132     ** The sqlite3_blob_close() function finalizes the vdbe program,
   133    133     ** which closes the b-tree cursor and (possibly) commits the 
   134    134     ** transaction.
   135    135     */
   136         -  static const int iLn = __LINE__+4;
          136  +  static const int iLn = VDBE_OFFSET_LINENO(4);
   137    137     static const VdbeOpList openBlob[] = {
   138    138       /* {OP_Transaction, 0, 0, 0},  // 0: Inserted separately */
   139    139       {OP_TableLock, 0, 0, 0},       /* 1: Acquire a read or write lock */
   140    140       /* One of the following two instructions is replaced by an OP_Noop. */
   141    141       {OP_OpenRead, 0, 0, 0},        /* 2: Open cursor 0 for reading */
   142    142       {OP_OpenWrite, 0, 0, 0},       /* 3: Open cursor 0 for read/write */
   143    143       {OP_Variable, 1, 1, 1},        /* 4: Push the rowid to the stack */