From 03dd9b486f654cbd5d069b1f32040eac771e1fc2 Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Mon, 11 Jan 2016 18:27:10 +0900 Subject: [PATCH] tweaked to include the bundled SQLite library version (RT-107040) --- lib/DBD/SQLite.pm | 15 +++++++++++++++ util/SQLiteUtil.pm | 18 ++++++++++++++++-- util/getsqlite.pl | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index c53c0d9..a6099ff 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -974,6 +974,21 @@ on how to use DBI itself. The API works like every DBI module does. However, currently many statement attributes are not implemented or are limited by the typeless nature of the SQLite database. +=head1 SQLITE VERSION + +DBD::SQLite is usually compiled with a bundled SQLite library +(SQLite version S<3.10.0> as of this release) for consistency. +However, a different version of SQLite may sometimes be used for +some reasons like security, or some new experimental features. + +You can look at C<$DBD::SQLite::sqlite_version> (C<3.x.y> format) or +C<$DBD::SQLite::sqlite_version_number> (C<3xxxyyy> format) +to find which version of SQLite is actually used. You can also +check C. + +You can also find how the library is compiled by calling +C (see below). + =head1 NOTABLE DIFFERENCES FROM OTHER DRIVERS =head2 Database Name Is A File Name diff --git a/util/SQLiteUtil.pm b/util/SQLiteUtil.pm index d7526ed..3f9f2f7 100644 --- a/util/SQLiteUtil.pm +++ b/util/SQLiteUtil.pm @@ -2,12 +2,14 @@ package SQLiteUtil; use strict; use warnings; +use FindBin; +use Cwd; use base 'Exporter'; use HTTP::Tiny; use File::Copy; our @EXPORT = qw/ - extract_constants versions srcdir mirror copy_files + extract_constants versions srcdir mirror copy_files tweak_pod check_api_history /; @@ -279,6 +281,18 @@ sub copy_files { copy("$dir/fts3_tokenizer.h", $ROOT); } +sub tweak_pod { + my $version = shift; + my $dotted = $version->dotted; + my $pmfile = "$ROOT/lib/DBD/SQLite.pm"; + my $body = do { open my $fh, '<', $pmfile or die $!; local $/; <$fh> }; + $body =~ s/S<[\d\.]+>/S<$dotted>/g or die "Can't find a placeholder for SQLite version"; + open my $out, '>', "$pmfile.tmp" or die $!; + print $out $body; + close $out; + rename "$pmfile.tmp" => $pmfile or die "Can't rename $pmfile.tmp to $pmfile: $!"; +} + sub check_api_history { require Array::Diff; my %current; @@ -346,7 +360,7 @@ sub as_num { sub dotted { my $self = shift; - join '.', $self->[3] ? @$self : @$self[0..2]; + join '.', map {$_ + 0} $self->[3] + 0 ? @$self : @$self[0..2]; } sub year { diff --git a/util/getsqlite.pl b/util/getsqlite.pl index 86f0c78..464c108 100644 --- a/util/getsqlite.pl +++ b/util/getsqlite.pl @@ -9,3 +9,4 @@ use SQLiteUtil; my $version = SQLiteUtil::Version->new(shift || (versions())[-1]); mirror($version); copy_files($version); +tweak_pod($version);