From: Peter Rabbitson Date: Fri, 3 Jul 2009 10:49:16 +0000 (+0000) Subject: Switch to C3 mro throughout the ::Storage hierarchy (DBIx::Class brings in MRO::Compa... X-Git-Tag: v0.08108~12^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2ad62d97476187e57d20ee49b39d7a7af864bb20;p=dbsrgits%2FDBIx-Class.git Switch to C3 mro throughout the ::Storage hierarchy (DBIx::Class brings in MRO::Compat, and all ::Storage's are based on it, tested on 5.8 --- diff --git a/lib/DBIx/Class/Storage.pm b/lib/DBIx/Class/Storage.pm index bf50762..e5c7d45 100644 --- a/lib/DBIx/Class/Storage.pm +++ b/lib/DBIx/Class/Storage.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base qw/DBIx::Class/; +use mro 'c3'; use Scalar::Util qw/weaken/; use Carp::Clan qw/^DBIx::Class/; diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index fdecba5..6f66848 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1,10 +1,12 @@ package DBIx::Class::Storage::DBI; # -*- mode: cperl; cperl-indent-level: 2 -*- -use base 'DBIx::Class::Storage'; - use strict; use warnings; + +use base 'DBIx::Class::Storage'; +use mro 'c3'; + use Carp::Clan qw/^DBIx::Class/; use DBI; use DBIx::Class::Storage::DBI::Cursor; diff --git a/lib/DBIx/Class/Storage/DBI/AmbiguousGlob.pm b/lib/DBIx/Class/Storage/DBI/AmbiguousGlob.pm index a7ed94b..37d1bd6 100644 --- a/lib/DBIx/Class/Storage/DBI/AmbiguousGlob.pm +++ b/lib/DBIx/Class/Storage/DBI/AmbiguousGlob.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base 'DBIx::Class::Storage::DBI'; +use mro 'c3'; =head1 NAME diff --git a/lib/DBIx/Class/Storage/DBI/Cursor.pm b/lib/DBIx/Class/Storage/DBI/Cursor.pm index 2868f88..3d59e84 100644 --- a/lib/DBIx/Class/Storage/DBI/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/Cursor.pm @@ -1,10 +1,10 @@ package DBIx::Class::Storage::DBI::Cursor; -use base qw/DBIx::Class::Cursor/; - use strict; use warnings; +use base qw/DBIx::Class::Cursor/; + =head1 NAME DBIx::Class::Storage::DBI::Cursor - Object representing a query cursor on a diff --git a/lib/DBIx/Class/Storage/DBI/DB2.pm b/lib/DBIx/Class/Storage/DBI/DB2.pm index 4988c06..7b48741 100644 --- a/lib/DBIx/Class/Storage/DBI/DB2.pm +++ b/lib/DBIx/Class/Storage/DBI/DB2.pm @@ -4,8 +4,7 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI/; - -# __PACKAGE__->load_components(qw/PK::Auto/); +use mro 'c3'; sub _dbh_last_insert_id { my ($self, $dbh, $source, $col) = @_; diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index 3a7ac84..3a1f868 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI::AmbiguousGlob DBIx::Class::Storage::DBI/; +use mro 'c3'; __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::MSSQL'); diff --git a/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm b/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm index 0a48805..2a757ea 100644 --- a/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm +++ b/lib/DBIx/Class/Storage/DBI/MultiColumnIn.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base 'DBIx::Class::Storage::DBI'; +use mro 'c3'; =head1 NAME diff --git a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm index 7027ad6..95f1cac 100644 --- a/lib/DBIx/Class/Storage/DBI/NoBindVars.pm +++ b/lib/DBIx/Class/Storage/DBI/NoBindVars.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base 'DBIx::Class::Storage::DBI'; +use mro 'c3'; =head1 NAME diff --git a/lib/DBIx/Class/Storage/DBI/ODBC.pm b/lib/DBIx/Class/Storage/DBI/ODBC.pm index 40d12aa..6f905af 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC.pm @@ -3,6 +3,7 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; sub _rebless { my ($self) = @_; diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm b/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm index c0df4b1..c951903 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/ACCESS.pm @@ -2,8 +2,10 @@ package DBIx::Class::Storage::DBI::ODBC::ACCESS; use strict; use warnings; -use DBI; use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; + +use DBI; my $ERR_MSG_START = __PACKAGE__ . ' failed: '; diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm index 5b8b348..33a4e7a 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm @@ -3,6 +3,7 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI::ODBC/; +use mro 'c3'; sub _dbh_last_insert_id { my ($self, $dbh, $source, $col) = @_; diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm index 48f6198..2fde285 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/Microsoft_SQL_Server.pm @@ -3,6 +3,8 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI::MSSQL/; +use mro 'c3'; + use List::Util(); sub insert_bulk { diff --git a/lib/DBIx/Class/Storage/DBI/Oracle.pm b/lib/DBIx/Class/Storage/DBI/Oracle.pm index f8f981b..1bb9f79 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle.pm @@ -4,6 +4,7 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; sub _rebless { my ($self) = @_; diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 46b76df..2f35cbd 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -24,7 +24,7 @@ This class implements autoincrements for Oracle. =cut use base qw/DBIx::Class::Storage::DBI/; -use Carp::Clan qw/^DBIx::Class/; +use mro 'c3'; # For ORA_BLOB => 113, ORA_CLOB => 112 use DBD::Oracle qw( :ora_types ); diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm b/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm index d4e7385..6604847 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm @@ -1,10 +1,11 @@ package DBIx::Class::Storage::DBI::Oracle::WhereJoins; -use base qw( DBIx::Class::Storage::DBI::Oracle::Generic ); - use strict; use warnings; +use base qw( DBIx::Class::Storage::DBI::Oracle::Generic ); +use mro 'c3'; + __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::OracleJoins'); 1; diff --git a/lib/DBIx/Class/Storage/DBI/SQLite.pm b/lib/DBIx/Class/Storage/DBI/SQLite.pm index 7fada30..1e5f298 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLite.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLite.pm @@ -2,12 +2,14 @@ package DBIx::Class::Storage::DBI::SQLite; use strict; use warnings; + +use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; + use POSIX 'strftime'; use File::Copy; use File::Spec; -use base qw/DBIx::Class::Storage::DBI/; - sub _dbh_last_insert_id { my ($self, $dbh, $source, $col) = @_; $dbh->func('last_insert_rowid'); diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 9b80f81..0a2cfb8 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -2,11 +2,12 @@ package DBIx::Class::Storage::DBI::Sybase; use strict; use warnings; -use mro 'c3'; + use base qw/ DBIx::Class::Storage::DBI::Sybase::Base DBIx::Class::Storage::DBI::NoBindVars /; +use mro 'c3'; sub _rebless { my $self = shift; diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm index 9ce130f..be57610 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Base.pm @@ -4,6 +4,9 @@ package # hide from PAUSE use strict; use warnings; +use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; + =head1 NAME DBIx::Class::Storage::DBI::Sybase::Base - Common functionality for drivers using diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm index dfd7a27..bd833df 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm @@ -15,6 +15,7 @@ carp 'Setting of storage_type is redundant as connections through DBD::Sybase' use base qw/DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server/; +use mro 'c3'; 1; diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm index e6809ec..600db7a 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/Microsoft_SQL_Server.pm @@ -2,11 +2,12 @@ package DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server; use strict; use warnings; -use mro 'c3'; + use base qw/ DBIx::Class::Storage::DBI::Sybase::Base DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server /; +use mro 'c3'; 1; diff --git a/lib/DBIx/Class/Storage/DBI/mysql.pm b/lib/DBIx/Class/Storage/DBI/mysql.pm index 90b9fe9..0eb53d2 100644 --- a/lib/DBIx/Class/Storage/DBI/mysql.pm +++ b/lib/DBIx/Class/Storage/DBI/mysql.pm @@ -8,6 +8,7 @@ use base qw/ DBIx::Class::Storage::DBI::AmbiguousGlob DBIx::Class::Storage::DBI /; +use mro 'c3'; __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::MySQL');