The _table_comment and _column_comment methods in ::DBI do queries on
the 'table_comments' and 'column_comments' tables for getting
table/column comments in databases which do not support them natively
(or well.) These tables usually do not exist.
DBD::ADO throws a warning from Win32::OLE when it encounters a query on
a table that does not exist. Here we trap and ignore those warnings for
the comments tables.
return $result;
}
+# Trap and ignore OLE warnings from nonexistant comments tables.
+
+sub _table_comment {
+ my $self = shift;
+
+ my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
+
+ local $SIG{__WARN__} = sub {
+ $warn_handler->(@_) unless $_[0] =~ /cannot find the input table/;
+ };
+
+ $self->next::method(@_);
+}
+
+sub _column_comment {
+ my $self = shift;
+
+ my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
+
+ local $SIG{__WARN__} = sub {
+ $warn_handler->(@_) unless $_[0] =~ /cannot find the input table/;
+ };
+
+ $self->next::method(@_);
+}
+
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader::DBI::ODBC::ACCESS>,