From: Justin Hunter Date: Thu, 30 Apr 2009 08:27:11 +0000 (+0000) Subject: jump to ::DBI::Sybase::MSSQL if we are using MSSQL through Sybase X-Git-Tag: v0.08103~118^2~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47d9646a1ef3d030d6a5456b0fa3d0a28a853e4a;p=dbsrgits%2FDBIx-Class.git jump to ::DBI::Sybase::MSSQL if we are using MSSQL through Sybase --- diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 87acdde..84499ed 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -5,6 +5,20 @@ use warnings; use base qw/DBIx::Class::Storage::DBI::NoBindVars/; +sub _rebless { + my $self = shift; + + my $dbh = $self->schema->storage->dbh; + my $DBMS_VERSION = @{$dbh->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})}[2]; + if ($DBMS_VERSION =~ /^Microsoft /i) { + my $subclass = 'DBIx::Class::Storage::DBI::Sybase::MSSQL'; + if ($self->load_optional_class($subclass) && !$self->isa($subclass)) { + bless $self, $subclass; + $self->_rebless; + } + } +} + 1; =head1 NAME @@ -21,6 +35,8 @@ L. Brandon L Black +Justin Hunter + =head1 LICENSE You may distribute this code under the same terms as Perl itself. diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm index 81222e9..f4eee43 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/MSSQL.pm @@ -3,8 +3,7 @@ package DBIx::Class::Storage::DBI::Sybase::MSSQL; use strict; use warnings; -use Class::C3; -use base qw/DBIx::Class::Storage::DBI::MSSQL DBIx::Class::Storage::DBI::Sybase/; +use base qw/DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server DBIx::Class::Storage::DBI::Sybase/; 1; @@ -29,6 +28,8 @@ after connecting. Brandon L Black +Justin Hunter + =head1 LICENSE You may distribute this code under the same terms as Perl itself.