about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2008-11-24 10:11:09 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2008-11-24 10:11:09 +0000
commit1357c14500cd4724e6f215893532cb46a7643351 (patch)
treecba3f5498ea9269a99fb9576ba701adc3ab563de /pkgs
parente02462f034f776ce3e1c38f1ad9b212e69d1e6be (diff)
* DBD::SQLite needs a patch to prevent segfaults in case of timeouts.
svn path=/nixpkgs/trunk/; revision=13386
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/perl-modules/DBD-SQLite/default.nix19
-rw-r--r--pkgs/development/perl-modules/DBD-SQLite/reset.patch40
-rw-r--r--pkgs/top-level/all-packages.nix10
3 files changed, 61 insertions, 8 deletions
diff --git a/pkgs/development/perl-modules/DBD-SQLite/default.nix b/pkgs/development/perl-modules/DBD-SQLite/default.nix
new file mode 100644
index 0000000000000..4b2936fe6ebfe
--- /dev/null
+++ b/pkgs/development/perl-modules/DBD-SQLite/default.nix
@@ -0,0 +1,19 @@
+{fetchurl, perl, perlDBI, sqlite}:
+
+import ../generic perl {
+  name = "DBD-SQLite-1.14";
+  
+  src = fetchurl {
+    url = mirror://cpan/authors/id/M/MS/MSERGEANT/DBD-SQLite-1.14.tar.gz;
+    sha256 = "01qd5xfx702chg3bv2k727kfdp84zy5xh31y6njvivkp78vrs624";
+  };
+  
+  propagatedBuildInputs = [perlDBI];
+  
+  makeMakerFlags = "SQLITE_LOCATION=${sqlite}";
+
+  patches = [
+    # Prevent segfaults in case of timeouts.
+    ./reset.patch
+  ];
+}
diff --git a/pkgs/development/perl-modules/DBD-SQLite/reset.patch b/pkgs/development/perl-modules/DBD-SQLite/reset.patch
new file mode 100644
index 0000000000000..af6a0b73796ed
--- /dev/null
+++ b/pkgs/development/perl-modules/DBD-SQLite/reset.patch
@@ -0,0 +1,40 @@
+diff -rc DBD-SQLite-1.14-orig/dbdimp.c DBD-SQLite-1.14/dbdimp.c
+*** DBD-SQLite-1.14-orig/dbdimp.c	2007-08-24 04:51:25.000000000 +0200
+--- DBD-SQLite-1.14/dbdimp.c	2008-11-10 18:31:53.000000000 +0100
+***************
+*** 398,405 ****
+              if (imp_sth->retval == SQLITE_ROW) {
+                  continue;
+              }
+!             /* There are bug reports that say this should be sqlite3_reset() */
+!             sqlite3_finalize(imp_sth->stmt);
+              sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db));
+              return -5;
+          }
+--- 398,404 ----
+              if (imp_sth->retval == SQLITE_ROW) {
+                  continue;
+              }
+!             sqlite3_reset(imp_sth->stmt);
+              sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db));
+              return -5;
+          }
+***************
+*** 418,425 ****
+          case SQLITE_DONE: DBIc_ACTIVE_on(imp_sth);
+                            sqlite_trace(5, "exec ok - %d rows, %d cols\n", imp_sth->nrow, DBIc_NUM_FIELDS(imp_sth));
+                            return 0;
+!                           /* There are bug reports that say this should be sqlite3_reset() */
+!         default:          sqlite3_finalize(imp_sth->stmt);
+                            sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db));
+                            return -6;
+      }
+--- 417,423 ----
+          case SQLITE_DONE: DBIc_ACTIVE_on(imp_sth);
+                            sqlite_trace(5, "exec ok - %d rows, %d cols\n", imp_sth->nrow, DBIc_NUM_FIELDS(imp_sth));
+                            return 0;
+!         default:          sqlite3_reset(imp_sth->stmt);
+                            sqlite_error(sth, (imp_xxh_t*)imp_sth, imp_sth->retval, (char*)sqlite3_errmsg(imp_dbh->db));
+                            return -6;
+      }
+Only in DBD-SQLite-1.14/: dbdimp.c~
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 606b9b8edfe65..bad41af7332ce 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4474,14 +4474,8 @@ let
     };
   };
 
-  perlDBDSQLite = import ../development/perl-modules/generic perl {
-    name = "DBD-SQLite-1.14";
-    src = fetchurl {
-      url = mirror://cpan/authors/id/M/MS/MSERGEANT/DBD-SQLite-1.14.tar.gz;
-      sha256 = "01qd5xfx702chg3bv2k727kfdp84zy5xh31y6njvivkp78vrs624";
-    };
-    propagatedBuildInputs = [perlDBI];
-    makeMakerFlags = "SQLITE_LOCATION=${sqlite}";
+  perlDBDSQLite = import ../development/perl-modules/DBD-SQLite {
+    inherit fetchurl perl perlDBI sqlite;
   };
 
   perlDBFile = import ../development/perl-modules/DB_File {