Subject: | Support for older perl and newer SQLite |
Hi,
2 things:
In Perl 5.8.4, the module doesn't seem to compile due to its use of
"Newxz" in perlvtab.c. Using "Newz" lets it compile on that version.
The module doesn't find the sqlite3ext.h file with newer SQLite distros,
which do away with the src directory. Looking in the top level dir as
well as src resolves this.
See the attached patch for suggested fixes for both issues.
After getting this working, the module worked great and is very useful!
Thanks and regards,
Mark
Subject: | sqlite-vt.patch |
diff -u -r SQLite-VirtualTable-0.03/Makefile.PL SQLite-VirtualTable-0.03-patched/Makefile.PL
--- SQLite-VirtualTable-0.03/Makefile.PL 2006-07-13 02:53:16.000000000 -0700
+++ SQLite-VirtualTable-0.03-patched/Makefile.PL 2009-08-24 14:59:07.000000000 -0700
@@ -17,7 +17,7 @@
defined $sqlite_source
or die "Usage: perl Makefile.PL SQLITE_SOURCE=/path/to/sqlite/source ...\n";
--f $sqlite_source . "/src/sqlite3ext.h"
+(-f $sqlite_source . "/src/sqlite3ext.h" || -f $sqlite_source . "/sqlite3ext.h")
or die "SQLite source not found on the path given\n";
WriteMakefile( NAME => 'SQLite::VirtualTable',
Only in SQLite-VirtualTable-0.03-patched: Makefile.bak
diff -u -r SQLite-VirtualTable-0.03/perlvtab.c SQLite-VirtualTable-0.03-patched/perlvtab.c
--- SQLite-VirtualTable-0.03/perlvtab.c 2006-07-13 03:27:57.000000000 -0700
+++ SQLite-VirtualTable-0.03-patched/perlvtab.c 2009-08-24 13:44:38.000000000 -0700
@@ -117,7 +117,7 @@
if (rc != SQLITE_OK)
goto cleanup;
- Newxz(vtab, 1, perl_vtab);
+ Newz(0, vtab, 1, perl_vtab);
vtab->sv = SvREFCNT_inc(vtabsv);
vtab->db = db;
#ifdef MULTIPLICITY
@@ -287,7 +287,7 @@
goto cleanup;
}
- Newxz(cursor, 1, perl_vtab_cursor);
+ Newz(0, cursor, 1, perl_vtab_cursor);
cursor->sv = SvREFCNT_inc(cursv);
SvREFCNT_inc(vtabsv);