From: Rafael Kitover Date: Tue, 1 Nov 2011 01:52:59 +0000 (-0400) Subject: fix some warnings for MSSQL over ADO X-Git-Tag: 0.07011~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b826c5890a50c641437a87a2f06ebe4d56d2a139;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix some warnings for MSSQL over ADO Fix invalid object warnings for nonexistant table/comment tables, and "Changed context" warnings for the extra database tests. --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI/ADO/Microsoft_SQL_Server.pm b/lib/DBIx/Class/Schema/Loader/DBI/ADO/Microsoft_SQL_Server.pm index b23a8ab..4af0525 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/ADO/Microsoft_SQL_Server.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/ADO/Microsoft_SQL_Server.pm @@ -21,6 +21,18 @@ Proxy for L when using L. See L for usage information. +=cut + +sub _table_comment { + local $^W = 0; # invalid object warnings + shift->next::method(@_); +} + +sub _column_comment { + local $^W = 0; # invalid object warnings + shift->next::method(@_); +} + =head1 SEE ALSO L, diff --git a/t/10_07mssql_common.t b/t/10_07mssql_common.t index ccdc8ff..5a31bef 100644 --- a/t/10_07mssql_common.t +++ b/t/10_07mssql_common.t @@ -497,6 +497,12 @@ EOF } SKIP: { + # for ADO + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; + local $SIG{__WARN__} = sub { + $warn_handler->(@_) unless $_[0] =~ /Changed database context/; + }; + my $dbh = $schema->storage->dbh; try { @@ -722,6 +728,12 @@ sub cleanup_schemas { sub cleanup_databases { return if $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}; + # for ADO + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; + local $SIG{__WARN__} = sub { + $warn_handler->(@_) unless $_[0] =~ /Changed database context/; + }; + my $dbh = $schema->storage->dbh; $dbh->do('USE dbicsl_test1');