On Mon, 27 Oct 2014 09:50:00 +0100, Peter Hopfgartner wrote:
> My setup is CentOS 6 with the default SQLite 3.6.20.
>
> I've compiled SptiaLite 4.2, but I'm not able to load SpatiaLite.
>
> sqlite> SELECT load_extension('mod_spatialite');
> Error: SQL logic error or missing database
> sqlite> SELECT load_extension('mod_spatialite.so');
> Error: SQL logic error or missing database
> sqlite> SELECT load_extension('libspatialite.so');
> Error: SQL logic error or missing database
>
> Is there something obvious that I am missing?
>
Hi Peter,
SQLite introduced many relevant changes affecting "load_extension"
starting since version 3.7.17
more specifically: the name of the link symbol expected to identify
the extension's entry point is now changed.
older versions of libsqlite3 (e.g. 3.6.20) are surely unaware of
such recent changes and will consequently be unable to correctly
locate the entry point thus causing a failure.
anyway a backward compatible mechanism exists allowing "old versions"
to successfully load a "new style" extension; you are simply expected
to explicitly reference the entry point name as the second (optional)
argument passed to "load_extension", e.g.:
SELECT load_extension('mod_spatialite', 'sqlite3_modspatialite_init');
another relevant changed introduced starting since 3.7.17 to be kept
in debt account: recent versions are much more sophisticated and will
attempt to locate the extension module in any reasonable platform
directory supposed to contain shared libraries.
and will automatically append the appropriate platform suffix (.dll,
.so)
so in many cases just referencing "mod_spatialite" will be enough.
on the other hand obsolete versions (< 3.7.17) were very limited;
passing the full extension's pathname (including any suffix) could
possibly help: e.g. "/usr/local/lib/mod_spatialite.so"
bye Sandro