Skip to content

Commit

Permalink
bump SQLITE_LIMIT_LENGTH to 2 MB
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederik-Baetens committed Sep 11, 2024
1 parent 35a35c3 commit 6a864b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/workerd/util/sqlite.c++
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,11 @@ void SqliteDatabase::setupSecurity() {
// 2. Reduce limits
// We use the suggested limits from the web site. Note that sqlite3_limit() does NOT return an
// error code; it returns the old limit.
sqlite3_limit(db, SQLITE_LIMIT_LENGTH, 1000000);

// This limit is set highter than what is suggested on sqlite.org/security.html
// because we want to allow storing values of 1MiB, and we added some extra
// padding on top of that
sqlite3_limit(db, SQLITE_LIMIT_LENGTH, 2000000);
sqlite3_limit(db, SQLITE_LIMIT_SQL_LENGTH, 100000);
sqlite3_limit(db, SQLITE_LIMIT_COLUMN, 100);
sqlite3_limit(db, SQLITE_LIMIT_EXPR_DEPTH, 100);
Expand Down

0 comments on commit 6a864b7

Please sign in to comment.