/ Check-in [cec2bcb4]
Login

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

Overview
Comment:Fix a bug in SQLITE_TRACE_SIZE_LIMIT that was introduced by check-in [1a1cf5aa86734c8]. That check-in was to remove harmless compiler warnings. So once again, we have introduced a real bug into SQLite by attempting to eliminate a harmless compiler warning.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cec2bcb45aa3f0438e19381ac863f0f876a1d1ad
User & Date: drh 2013-05-17 17:15:34
Context
2013-05-17
20:16
Remove a stray tab character from the transitive_closure extension source code. check-in: 7a9aa21c user: drh tags: trunk
17:15
Fix a bug in SQLITE_TRACE_SIZE_LIMIT that was introduced by check-in [1a1cf5aa86734c8]. That check-in was to remove harmless compiler warnings. So once again, we have introduced a real bug into SQLite by attempting to eliminate a harmless compiler warning. check-in: cec2bcb4 user: drh tags: trunk
16:41
In test file test_syscall.c, include sqliteInt.h before any tcl or system include files. This ensures that the magical defines in sqliteInt.h really do enable large file support (and set things up so that sizeof(off_t)==8). check-in: 0f355bb1 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbetrace.c.

   138    138             sqlite3VdbeMemSetStr(&utf8, pVar->z, pVar->n, enc, SQLITE_STATIC);
   139    139             sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8);
   140    140             pVar = &utf8;
   141    141           }
   142    142   #endif
   143    143           nOut = pVar->n;
   144    144   #ifdef SQLITE_TRACE_SIZE_LIMIT
   145         -        if( n>SQLITE_TRACE_SIZE_LIMIT ){
          145  +        if( nOut>SQLITE_TRACE_SIZE_LIMIT ){
   146    146             nOut = SQLITE_TRACE_SIZE_LIMIT;
   147         -          while( nOut<pVar->n && (pVar->z[n]&0xc0)==0x80 ){ n++; }
          147  +          while( nOut<pVar->n && (pVar->z[nOut]&0xc0)==0x80 ){ nOut++; }
   148    148           }
   149    149   #endif    
   150    150           sqlite3XPrintf(&out, "'%.*q'", nOut, pVar->z);
   151    151   #ifdef SQLITE_TRACE_SIZE_LIMIT
   152         -        if( nOut<pVar->n ) sqlite3XPrintf(&out, "/*+%d bytes*/", pVar->n-n);
          152  +        if( nOut<pVar->n ) sqlite3XPrintf(&out, "/*+%d bytes*/", pVar->n-nOut);
   153    153   #endif
   154    154   #ifndef SQLITE_OMIT_UTF16
   155    155           if( enc!=SQLITE_UTF8 ) sqlite3VdbeMemRelease(&utf8);
   156    156   #endif
   157    157         }else if( pVar->flags & MEM_Zero ){
   158    158           sqlite3XPrintf(&out, "zeroblob(%d)", pVar->u.nZero);
   159    159         }else{
................................................................................
   165    165           if( nOut>SQLITE_TRACE_SIZE_LIMIT ) nOut = SQLITE_TRACE_SIZE_LIMIT;
   166    166   #endif
   167    167           for(i=0; i<nOut; i++){
   168    168             sqlite3XPrintf(&out, "%02x", pVar->z[i]&0xff);
   169    169           }
   170    170           sqlite3StrAccumAppend(&out, "'", 1);
   171    171   #ifdef SQLITE_TRACE_SIZE_LIMIT
   172         -        if( nOut<pVar->n ) sqlite3XPrintf(&out, "/*+%d bytes*/", pVar->n-n);
          172  +        if( nOut<pVar->n ) sqlite3XPrintf(&out, "/*+%d bytes*/", pVar->n-nOut);
   173    173   #endif
   174    174         }
   175    175       }
   176    176     }
   177    177     return sqlite3StrAccumFinish(&out);
   178    178   }
   179    179