From c2f8f58179a1fef21043d18c8c08d34f766a7671 Mon Sep 17 00:00:00 2001 From: Adam Kennedy Date: Wed, 12 Aug 2009 05:48:47 +0000 Subject: [PATCH] Final tweaks for the new release --- Changes | 2 ++ Makefile.PL | 22 ++++++++++++++++++---- lib/DBD/SQLite.pm | 29 +++++++++++++++++------------ 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index df4dc4f..7d352e4 100644 --- a/Changes +++ b/Changes @@ -20,6 +20,8 @@ Changes for Perl extension DBD-SQLite - Replaced imp_dbh->in_tran with sqlite3_get_autocommit(), hoping this would fix the annoying rollback issues, including #48393 (ISHIGAKI) + - META.yml requires is now generated instead of being derived from the + (incorrect) PREREQ_PM values by ExtUtils::MakeMaker (ADAMK) 1.26_02 Fri 19 Jun 2009 - Updated to SQLite 3.6.15 (DUNCAND) diff --git a/Makefile.PL b/Makefile.PL index 3f05aa8..349a423 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -202,6 +202,7 @@ WriteMakefile( ABSTRACT => 'Self Contained SQLite RDBMS in a DBI Driver', VERSION_FROM => 'lib/DBD/SQLite.pm', PREREQ_PM => { + 'Tie::Hash' => 0, 'File::Spec' => (WINLIKE ? '3.27' : '0.82'), 'DBI' => $DBI_required, 'Test::More' => '0.42', @@ -216,19 +217,32 @@ WriteMakefile( LICENSE => 'perl', ), OPTIONAL( '6.11', - AUTHOR => 'Adam Kennedy ', # Release manager (can this be an array?) + # Release manager (can this be an array?) + AUTHOR => 'Adam Kennedy ', ), OPTIONAL( '6.46', - META_MERGE => { + # Use META_ADD instead of META_MERGE so that we can remove + # any build-time dependencies that MakeMaker will put into + # the requires field. + META_ADD => { configure_requires => { 'ExtUtils::MakeMaker' => '6.48', - 'File::Spec' => '0.82', # This is not allowed to be computed + # This is not allowed to be computed + 'File::Spec' => '0.82', 'DBI' => $DBI_required, }, build_requires => { 'File::Spec' => (WINLIKE ? '3.27' : '0.82'), 'Test::More' => '0.42', - # 'Test::NoWarnings' => '0.081', # Bundled in /inc + # Bundled in /inc + # 'Test::NoWarnings' => '0.081', + }, + requires => { + 'Tie::Hash' => 0, + 'DBI' => $DBI_required, + ( WINLIKE ? ( + 'Win32' => '0.30', + ) : () ), }, resources => { license => 'http://dev.perl.org/licenses/', diff --git a/lib/DBD/SQLite.pm b/lib/DBD/SQLite.pm index 38db3bb..9256e08 100644 --- a/lib/DBD/SQLite.pm +++ b/lib/DBD/SQLite.pm @@ -22,17 +22,14 @@ BEGIN { # sqlite_version cache $sqlite_version = undef; - } __PACKAGE__->bootstrap($VERSION); -tie %COLLATION, 'DBD::SQLite::_WriteOnceHash'; +tie %COLLATION, 'DBD::SQLite::_WriteOnceHash'; $COLLATION{perl} = sub { $_[0] cmp $_[1] }; $COLLATION{perllocale} = sub { use locale; $_[0] cmp $_[1] }; - - my $methods_are_installed; sub driver { @@ -70,8 +67,6 @@ sub CLONE { undef $drh; } - - package DBD::SQLite::dr; sub connect { @@ -617,8 +612,9 @@ e.g., "2.8.0". Can only be read. =item unicode -If set to a true value, B will turn the UTF-8 flag on for all text -strings coming out of the database (this feature is currently disabled for perl < 5.8.5). For more details on the UTF-8 flag see +If set to a true value, B will turn the UTF-8 flag on for all +text strings coming out of the database (this feature is currently disabled +for perl < 5.8.5). For more details on the UTF-8 flag see L. The default is for the UTF-8 flag to be turned off. Also note that due to some bizarreness in SQLite's type system (see @@ -641,7 +637,12 @@ Defining the column type as C in the DDL is B sufficient. =head1 DRIVER PRIVATE METHODS -The following methods can be called via the func() method with a little tweak, but the use of func() method is now discouraged by the L author for various reasons (see DBI's document L for details). So, if you're using L >= 1.608, use these C methods. If you need to use an older L, you can call these like this: +The following methods can be called via the func() method with a little +tweak, but the use of func() method is now discouraged by the L author +for various reasons (see DBI's document +L +for details). So, if you're using L >= 1.608, use these C +methods. If you need to use an older L, you can call these like this: $dbh->func( ..., "(method name without sqlite_ prefix)" ); @@ -1259,14 +1260,17 @@ with B and use the supplied C command line tool. =head1 FUNCTIONS AND BIND PARAMETERS -As of this writing, a SQL that compares a return value of a function with a numeric bind value like this doesn't work as you might expect. +As of this writing, a SQL that compares a return value of a function with a +numeric bind value like this doesn't work as you might expect. my $sth = $dbh->prepare(q{ SELECT bar FROM foo GROUP BY bar HAVING count(*) > ?; }); $sth->execute(5); -This is because DBD::SQLite assumes that all the bind values are text (and should be quoted) by default. Thus the above statement becomes like this while executing: +This is because DBD::SQLite assumes that all the bind values are text (and +should be quoted) by default. Thus the above statement becomes like this +while executing: SELECT bar FROM foo GROUP BY bar HAVING count(*) > "5"; @@ -1276,7 +1280,8 @@ There are two workarounds for this. =item Use bind_param() explicitly -As shown above in the C section, you can always use C to tell the type of a bind value. +As shown above in the C section, you can always use C to +tell the type of a bind value. use DBI qw(:sql_types); # Don't forget this