From 4b9295c18601e734040f1438c61762d42b900541 Mon Sep 17 00:00:00 2001 From: Julius de Bruijn Date: Wed, 15 May 2019 10:33:22 +0200 Subject: [PATCH] Increase bundled SQLite variables and depth We've been hitting the default `MAX_VARIABLE_NUMBER` and `MAX_EXPR_DEPTH` with quite basic tests here in Prisma. I was able to run the tests by using the Arch Linux packaged libsqlite3, but when turning on the bundled version I was able to get my test to crash with this test project: https://github.com/pimeys/sqlite_parameter_test Now taking a look how Arch Linux builds sqlite, I was able to find two flags fixing the issue: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/sqlite#n35 I think it would be safe to include them in rusqlite. --- libsqlite3-sys/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libsqlite3-sys/build.rs b/libsqlite3-sys/build.rs index e6942d0..fc83890 100644 --- a/libsqlite3-sys/build.rs +++ b/libsqlite3-sys/build.rs @@ -52,6 +52,8 @@ mod build_bundled { let mut cfg = cc::Build::new(); cfg.file("sqlite3/sqlite3.c") .flag("-DSQLITE_CORE") + .flag("-DSQLITE_MAX_VARIABLE_NUMBER=250000") + .flag("-DSQLITE_MAX_EXPR_DEPTH=10000") .flag("-DSQLITE_DEFAULT_FOREIGN_KEYS=1") .flag("-DSQLITE_ENABLE_API_ARMOR") .flag("-DSQLITE_ENABLE_COLUMN_METADATA")