From 801210e2166ec03b253b9ea1ccf42a72d505eb7e Mon Sep 17 00:00:00 2001 From: Jose Pedro Oliveira Date: Wed, 5 Apr 2006 16:53:21 +0000 Subject: [PATCH] - Patch to build with system sqlite 3.3.x (#183530). - Patch to avoid VIEW type information segv (#187873). --- ...Lite-1.11-VIEW-type-information-segv.patch | 22 +++++++++++++++++++ ...-1.11-build-with-system-sqlite-3.3.x.patch | 21 ++++++++++++++++++ perl-DBD-SQLite.spec | 12 ++++++++-- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 DBD-SQLite-1.11-VIEW-type-information-segv.patch create mode 100644 DBD-SQLite-1.11-build-with-system-sqlite-3.3.x.patch diff --git a/DBD-SQLite-1.11-VIEW-type-information-segv.patch b/DBD-SQLite-1.11-VIEW-type-information-segv.patch new file mode 100644 index 0000000..9176d46 --- /dev/null +++ b/DBD-SQLite-1.11-VIEW-type-information-segv.patch @@ -0,0 +1,22 @@ +diff -ur DBD-SQLite-1.11.orig/dbdimp.c DBD-SQLite-1.11/dbdimp.c +--- DBD-SQLite-1.11.orig/dbdimp.c 2005-12-02 17:28:53.000000000 +0000 ++++ DBD-SQLite-1.11/dbdimp.c 2006-02-06 12:10:31.000000000 +0000 +@@ -677,11 +677,15 @@ + retsv = sv_2mortal(newRV(sv_2mortal((SV*)av))); + for (n = 0; n < i; n++) { + const char *fieldtype = sqlite3_column_decltype(imp_sth->stmt, n); +- int type = sqlite3_column_type(imp_sth->stmt, n); ++ /* int type = sqlite3_column_type(imp_sth->stmt, n); */ + /* warn("got type: %d = %s\n", type, fieldtype); */ +- type = type_to_odbc_type(type); ++ /* type = type_to_odbc_type(type); */ + /* av_store(av, n, newSViv(type)); */ +- av_store(av, n, newSVpv(fieldtype, 0)); ++ if (fieldtype == NULL) { ++ av_store(av, n, newSVpv("INTEGER", 0)); ++ } else { ++ av_store(av, n, newSVpv(fieldtype, 0)); ++ } + } + } + else if (strEQ(key, "NULLABLE")) { diff --git a/DBD-SQLite-1.11-build-with-system-sqlite-3.3.x.patch b/DBD-SQLite-1.11-build-with-system-sqlite-3.3.x.patch new file mode 100644 index 0000000..b919f99 --- /dev/null +++ b/DBD-SQLite-1.11-build-with-system-sqlite-3.3.x.patch @@ -0,0 +1,21 @@ +diff -durN DBD-SQLite-1.11/dbdimp.c DBD-SQLite-1.11.new/dbdimp.c +--- DBD-SQLite-1.11/dbdimp.c Sat Dec 3 01:28:53 2005 ++++ DBD-SQLite-1.11.new/dbdimp.c Mon Mar 27 09:18:19 2006 +@@ -260,7 +260,7 @@ + imp_sth->retval = SQLITE_OK; + imp_sth->params = newAV(); + +- if ((retval = sqlite3_prepare(imp_dbh->db, statement, 0, &(imp_sth->stmt), &extra)) ++ if ((retval = sqlite3_prepare(imp_dbh->db, statement, -1, &(imp_sth->stmt), &extra)) + != SQLITE_OK) + { + if (imp_sth->stmt) { +@@ -320,7 +320,7 @@ + psv = hv_fetch((HV*)SvRV(sth), "Statement", 9, 0); + statement = (psv && SvOK(*psv)) ? SvPV_nolen(*psv) : ""; + sqlite_trace(3, "re-prepare statement %s", statement); +- if ((retval = sqlite3_prepare(imp_dbh->db, statement, 0, &(imp_sth->stmt), &extra)) ++ if ((retval = sqlite3_prepare(imp_dbh->db, statement, -1, &(imp_sth->stmt), &extra)) + != SQLITE_OK) + { + if (imp_sth->stmt) { diff --git a/perl-DBD-SQLite.spec b/perl-DBD-SQLite.spec index 471910c..1721538 100644 --- a/perl-DBD-SQLite.spec +++ b/perl-DBD-SQLite.spec @@ -1,12 +1,14 @@ Name: perl-DBD-SQLite Version: 1.11 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Self Contained RDBMS in a DBI Driver Group: Development/Libraries License: GPL or Artistic URL: http://search.cpan.org/dist/DBD-SQLite/ Source0: http://www.cpan.org/authors/id/M/MS/MSERGEANT/DBD-SQLite-%{version}.tar.gz +Patch0: DBD-SQLite-1.11-build-with-system-sqlite-3.3.x.patch +Patch1: DBD-SQLite-1.11-VIEW-type-information-segv.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: perl-DBI >= 1.03 @@ -30,10 +32,12 @@ As of version 1.09 it can use the external SQLite library (>= 3.1.3). %prep %setup -q -n DBD-SQLite-%{version} +%patch0 -p1 +%patch1 -p1 %build -CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL INSTALLDIRS=vendor USE_LOCAL_SQLITE=1 +CFLAGS="$RPM_OPT_FLAGS" %{__perl} Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} OPTIMIZE="$RPM_OPT_FLAGS" @@ -63,6 +67,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 5 2006 Jose Pedro Oliveira - 1.11-4 +- Patch to build with system sqlite 3.3.x (#183530). +- Patch to avoid VIEW type information segv (#187873). + * Thu Mar 9 2006 Jose Pedro Oliveira - 1.11-3 - DBD::SQLite fails to build with the current FC-5 sqlite version (3.3.3); see bugzilla entry #183530.