From aa5d3f6150f6b4125bf02d739421e7e60b9abc51 Mon Sep 17 00:00:00 2001 From: Frederik-Baetens Date: Wed, 11 Sep 2024 11:38:10 +0100 Subject: [PATCH] bump SQLITE_LIMIT_LENGTH to 2 MB (#2682) --- src/workerd/util/sqlite.c++ | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/workerd/util/sqlite.c++ b/src/workerd/util/sqlite.c++ index ba4548e8b6f..0e9f139a06b 100644 --- a/src/workerd/util/sqlite.c++ +++ b/src/workerd/util/sqlite.c++ @@ -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);