Add a Class::C3::reinitialize() under 5.8 after the ::DBI ->_rebless.
Also make sure MRO::Compat is loaded everywhere it needs to be and
everything does a use mro 'c3';.
Revision history for Perl extension DBIx::Class::Schema::Loader
+ - fix some mro issues under perl 5.8
+
0.07019 2012-03-28 17:23:09
- fix some errors due to case issues (RT#75805)
use strict;
use warnings;
use base qw/Class::Accessor::Grouped Class::C3::Componentised/;
+use MRO::Compat;
use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use DBIx::Class::Schema::Loader::RelBuilder ();
my $driver = $self->dbh->{Driver}->{Name};
my $subclass = 'DBIx::Class::Schema::Loader::DBI::' . $driver;
- if ($self->load_optional_class($subclass)) {
- bless $self, $subclass unless $self->isa($subclass);
+ if ((not $self->isa($subclass)) && $self->load_optional_class($subclass)) {
+ bless $self, $subclass;
$self->_rebless;
+ Class::C3::reinitialize() if $] < 5.009005;
}
}
$self->_setup;
- $self;
+ return $self;
}
sub _build_quote_char {
use strict;
use warnings;
+use base 'DBIx::Class::Schema::Loader::DBI';
use mro 'c3';
our $VERSION = '0.07019';
use strict;
use warnings;
-use mro 'c3';
use base qw/DBIx::Class::Schema::Loader::DBI/;
+use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use List::Util 'first';
use namespace::clean;
use strict;
use warnings;
-use base qw/
- DBIx::Class::Schema::Loader::DBI::ODBC
-/;
+use base 'DBIx::Class::Schema::Loader::DBI::ODBC';
use mro 'c3';
use Try::Tiny;
use namespace::clean;
use strict;
use warnings;
-use base qw/
- DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault
- DBIx::Class::Schema::Loader::DBI
-/;
+use base 'DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault';
use mro 'c3';
use Try::Tiny;
use namespace::clean;
use strict;
use warnings;
-use base qw/
- DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault
- DBIx::Class::Schema::Loader::DBI
-/;
+use base 'DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault';
use mro 'c3';
our $VERSION = '0.07019';
use strict;
use warnings;
-use base qw/
- DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault
- DBIx::Class::Schema::Loader::DBI
-/;
+use base 'DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault';
use mro 'c3';
use List::MoreUtils 'any';
use namespace::clean;
use strict;
use warnings;
-use base qw/
- DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault
- DBIx::Class::Schema::Loader::DBI
-/;
+use base 'DBIx::Class::Schema::Loader::DBI::Component::QuotedDefault';
use mro 'c3';
use DBIx::Class::Schema::Loader::Table ();
use strict;
use warnings;
use base 'Class::Accessor::Grouped';
+use mro 'c3';
use Carp::Clan qw/^DBIx::Class/;
use Scalar::Util 'weaken';
use namespace::clean;
use strict;
use warnings;
use base 'DBIx::Class::Schema::Loader::DBObject';
+use mro 'c3';
use namespace::clean;
=head1 NAME
use strict;
use warnings;
use base 'DBIx::Class::Schema::Loader::DBObject';
+use mro 'c3';
use namespace::clean;
=head1 NAME
use strict;
use warnings;
use base 'DBIx::Class::Schema::Loader::DBObject';
+use mro 'c3';
=head1 NAME
use strict;
use warnings;
use base 'DBIx::Class::Schema::Loader::DBObject::Informix';
+use mro 'c3';
=head1 NAME
use strict;
use warnings;
use base 'DBIx::Class::Schema::Loader::DBObject::Sybase';
+use mro 'c3';
=head1 NAME
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+use DBIx::Class::Schema::Loader;
+
+# use this if you keep a copy of DBD::Sybase linked to FreeTDS somewhere else
+BEGIN {
+ if (my $lib_dirs = $ENV{DBICTEST_MSSQL_PERL5LIB}) {
+ unshift @INC, $_ for split /:/, $lib_dirs;
+ }
+}
+
+my ($dsn, $user, $pass);
+
+for (qw/MSSQL_ODBC MSSQL_ADO MSSQL/) {
+ next unless $ENV{"DBICTEST_${_}_DSN"};
+
+ $dsn = $ENV{"DBICTEST_${_}_DSN"};
+ $user = $ENV{"DBICTEST_${_}_USER"};
+ $pass = $ENV{"DBICTEST_${_}_PASS"};
+
+ last;
+}
+
+plan skip_all => 'perl 5.8 required for this test'
+ if $] >= 5.009005;
+
+plan ($dsn ? (tests => 1) : (skip_all => 'MSSQL required for this test'));
+
+lives_ok {
+ DBIx::Class::Schema::Loader::make_schema_at(
+ 'DBICTest::Schema',
+ { naming => 'current' },
+ [ $dsn, $user, $pass ],
+ );
+} 'dynamic MSSQL schema created using make_schema_at';
+
+done_testing;