/ Check-in [3aed949a]
Login

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

Overview
Comment:Fix misplaced testcase() macros from the previous check-in.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3aed949a18a251c5795f21f0385c205a127502b7e9cf06bc7f4c763951cd7984
User & Date: drh 2018-02-10 02:31:30
Context
2018-02-12
13:30
Fix a possible infinite loop in VACUUM that can come up when the schema has been carefully corrupted. Problem discovered by OSSFuzz. Test cases in TH3. check-in: 27754b74 user: drh tags: trunk
2018-02-10
17:41
Add the start of the "zonefile" extension. check-in: c125b4c3 user: dan tags: zonefile
02:31
Fix misplaced testcase() macros from the previous check-in. check-in: 3aed949a user: drh tags: trunk
2018-02-09
23:25
Improve the performance of the built-in REPLACE() function in cases where it does many substitutions that make the string larger. OSSFuzz is reporting intermittant timeouts when running a test where it does a REPLACE() on a 930KB random blob. Perhaps this enhancement will fix that. check-in: fab2c2b0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

  1235   1235     cntExpand = 0;
  1236   1236     for(i=j=0; i<=loopLimit; i++){
  1237   1237       if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){
  1238   1238         zOut[j++] = zStr[i];
  1239   1239       }else{
  1240   1240         if( nRep>nPattern ){
  1241   1241           nOut += nRep - nPattern;
         1242  +        testcase( nOut-1==db->aLimit[SQLITE_LIMIT_LENGTH] );
         1243  +        testcase( nOut-2==db->aLimit[SQLITE_LIMIT_LENGTH] );
  1242   1244           if( nOut-1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
  1243   1245             sqlite3_result_error_toobig(context);
  1244   1246             sqlite3_free(zOut);
  1245   1247             return;
  1246   1248           }
  1247         -        testcase( nOut-1==db->aLimit[SQLITE_LIMIT_LENGTH] );
  1248         -        testcase( nOut-2==db->aLimit[SQLITE_LIMIT_LENGTH] );
  1249   1249           cntExpand++;
  1250   1250           if( (cntExpand&(cntExpand-1))==0 ){
  1251   1251             /* Grow the size of the output buffer only on substitutions
  1252   1252             ** whose index is a power of two: 1, 2, 4, 8, 16, 32, ... */
  1253   1253             u8 *zOld;
  1254   1254             zOld = zOut;
  1255   1255             zOut = sqlite3_realloc64(zOut, (int)nOut + (nOut - nStr - 1));