From 74e976c4c6f2494bc62070fe90f64e58fb1971e6 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 13 Feb 2025 13:50:11 +0100 Subject: [PATCH] sqlite: backport patch to resolve regression in 3.48.0 Unblocks the test suite of nodejs and probably other packages. --- .../sqlite/3.48.0-fk-conflict-handling.patch | 16 ++++++++++++++++ pkgs/development/libraries/sqlite/default.nix | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 pkgs/development/libraries/sqlite/3.48.0-fk-conflict-handling.patch diff --git a/pkgs/development/libraries/sqlite/3.48.0-fk-conflict-handling.patch b/pkgs/development/libraries/sqlite/3.48.0-fk-conflict-handling.patch new file mode 100644 index 000000000000..6e3f58a7212d --- /dev/null +++ b/pkgs/development/libraries/sqlite/3.48.0-fk-conflict-handling.patch @@ -0,0 +1,16 @@ +diff --git a/sqlite3.c b/sqlite3.c +index 80433f6..7c234f6 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -231721,6 +231721,11 @@ static int sessionChangesetApply( + } + } + ++ { ++ int rc2 = sqlite3_exec(db, "PRAGMA defer_foreign_keys = 0", 0, 0, 0); ++ if( rc==SQLITE_OK ) rc = rc2; ++ } ++ + if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){ + if( rc==SQLITE_OK ){ + rc = sqlite3_exec(db, "RELEASE changeset_apply", 0, 0, 0); diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix index 670fad6e538d..6a1f0f622be4 100644 --- a/pkgs/development/libraries/sqlite/default.nix +++ b/pkgs/development/libraries/sqlite/default.nix @@ -34,6 +34,11 @@ stdenv.mkDerivation rec { # Can be removed with the next release. # Test: pkgsStatic.gnupg ./Libs.private.patch + + # https://sqlite.org/forum/forumpost/00f3aab3d3be9690 + # https://sqlite.org/src/info/d7c07581 + # TODO: Remove in 3.49.0 + ./3.48.0-fk-conflict-handling.patch ]; outputs = [ "bin" "dev" "man" "doc" "out" ];