From: Peter Rabbitson Date: Fri, 3 Jul 2009 10:47:57 +0000 (+0000) Subject: Ask for newer DBD::Pg in author mode, suggest the newer version otherwise (proper... X-Git-Tag: v0.08108~12^2~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ac45262b7c3b56db2c8606c4cad46aa448b1169c;hp=ac93965c38f39697a3f568f4616f5e20237536ea;p=dbsrgits%2FDBIx-Class.git Ask for newer DBD::Pg in author mode, suggest the newer version otherwise (proper array support). Make test more resilient as well --- diff --git a/Makefile.PL b/Makefile.PL index d69dfd5..72c7fd3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -94,6 +94,7 @@ my %force_requires_if_author = ( $ENV{DBICTEST_PG_DSN} ? ( 'Sys::SigAction' => 0, + 'DBD::Pg' => 2.009002, 'DateTime::Format::Pg' => 0, ) : () , diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 41b2357..f53de4b 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -3,15 +3,14 @@ package DBIx::Class::Storage::DBI::Pg; use strict; use warnings; -use DBD::Pg qw(:pg_types); - use base qw/DBIx::Class::Storage::DBI::MultiColumnIn/; +use mro 'c3'; -# __PACKAGE__->load_components(qw/PK::Auto/); +use DBD::Pg qw(:pg_types); -# Warn about problematic versions of DBD::Pg -warn "DBD::Pg 1.49 is strongly recommended" - if ($DBD::Pg::VERSION < 1.49); +# Ask for a DBD::Pg with array support +warn "DBD::Pg 2.9.2 or greater is strongly recommended" + if ($DBD::Pg::VERSION < 2.009002); # pg uses (used?) version::qv() sub with_deferred_fk_checks { my ($self, $sub) = @_; diff --git a/t/72pg.t b/t/72pg.t index 05470a6..a5b5ac4 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -144,7 +144,9 @@ like($artistid_defval, is_deeply($type_info, $test_type_info, 'columns_info_for - column data types'); -{ +SKIP: { + skip "Need DBD::Pg 2.9.2 or newer for array tests", 4 if $DBD::Pg::VERSION < 2.009002; + lives_ok { $schema->resultset('ArrayTest')->create({ arrayfield => [1, 2], diff --git a/t/from_subquery.t b/t/from_subquery.t index 8c777ea..9b340c5 100644 --- a/t/from_subquery.t +++ b/t/from_subquery.t @@ -3,17 +3,12 @@ use warnings FATAL => 'all'; use Test::More; -BEGIN { - eval "use SQL::Abstract 1.49"; - plan $@ - ? ( skip_all => "Needs SQLA 1.49+" ) - : ( tests => 8 ); -} - use lib qw(t/lib); use DBICTest; use DBIC::SqlMakerTest; +plan tests => 8; + my $schema = DBICTest->init_schema(); my $art_rs = $schema->resultset('Artist'); my $cdrs = $schema->resultset('CD');