Release 0.07034_01
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / ADO / Microsoft_SQL_Server.pm
index b23a8ab..5e38404 100644 (file)
@@ -8,7 +8,7 @@ use base qw/
 /;
 use mro 'c3';
 
-our $VERSION = '0.07010';
+our $VERSION = '0.07034_01';
 
 =head1 NAME
 
@@ -21,6 +21,18 @@ Proxy for L<DBIx::Class::Schema::Loader::DBI::MSSQL> when using L<DBD::ADO>.
 
 See L<DBIx::Class::Schema::Loader::Base> for usage information.
 
+=cut
+
+# Silence ADO "Changed database context" warnings
+sub _switch_db {
+    my $self = shift;
+    my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
+    local $SIG{__WARN__} = sub {
+        $warn_handler->(@_) unless $_[0] =~ /Changed database context/;
+    };
+    return $self->next::method(@_);
+}
+
 =head1 SEE ALSO
 
 L<DBIx::Class::Schema::Loader::DBI::ADO>,