/ Check-in [d655a665]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Limit the length of sqlite3_mprintf() output to 2^30 bytes, even if SQLITE_MAX_LENGTH is set larger at compile-time.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d655a665acfae676d30e90e3731f483bee6acc63
User & Date: drh 2016-01-04 04:28:11
References
2016-01-04
12:07
A new approach to very large sqlite3_mprintf() strings: Back out the [d655a665] check-in and instead make the size fields in StrAccum unsigned. Strings generated by sqlite3_mprintf() can now be as large as 2^31-1 bytes. check-in: 7adb789f user: drh tags: trunk
Context
2016-01-04
04:41
Adjust the vtabH.test module to ignore files in the root directory of Windows machines that contain the "$" character. check-in: 73e33550 user: drh tags: trunk
04:28
Limit the length of sqlite3_mprintf() output to 2^30 bytes, even if SQLITE_MAX_LENGTH is set larger at compile-time. check-in: d655a665 user: drh tags: trunk
03:48
Fix a harmless compiler warning. check-in: 4b404a99 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/printf.c.

   961    961       (void)SQLITE_MISUSE_BKPT;
   962    962       return 0;
   963    963     }
   964    964   #endif
   965    965   #ifndef SQLITE_OMIT_AUTOINIT
   966    966     if( sqlite3_initialize() ) return 0;
   967    967   #endif
          968  +#if SQLITE_MAX_LENGTH<0x40000000
   968    969     sqlite3StrAccumInit(&acc, 0, zBase, sizeof(zBase), SQLITE_MAX_LENGTH);
          970  +#else
          971  +  sqlite3StrAccumInit(&acc, 0, zBase, sizeof(zBase), 0x3fffffff);
          972  +#endif
          973  +
   969    974     sqlite3VXPrintf(&acc, 0, zFormat, ap);
   970    975     z = sqlite3StrAccumFinish(&acc);
   971    976     return z;
   972    977   }
   973    978   
   974    979   /*
   975    980   ** Print into memory obtained from sqlite3_malloc()().  Omit the internal