if ($dbh->can('column_info')) {
my %result;
eval {
- my $sth = do {
- # FIXME - seems to only warn on MySQL, and even then the output is valuable
- # need to figure out how no to mask it away (and still have tests pass)
- local $SIG{__WARN__} = sub {};
- $dbh->column_info( undef, $self->db_schema, $table, '%' );
- };
+ my $sth = $self->_dbh_column_info($dbh, undef, $self->db_schema, $table, '%' );
while ( my $info = $sth->fetchrow_hashref() ){
my $column_info = {};
$column_info->{data_type} = lc $info->{TYPE_NAME};
return \%result;
}
-# Override this in vendor class to return any additional column
-# attributes
+# do not use this, override _columns_info_for instead
sub _extra_column_info {}
+# override to mask warnings if needed (see mysql)
+sub _dbh_column_info {
+ my ($self, $dbh) = (shift, shift);
+
+ return $dbh->column_info(@_);
+}
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader>
}
sub _table_uniq_info {
+ no warnings 'uninitialized'; # for presumably XS weirdness with null operations
my ($self, $table) = @_;
- # FIXME - remove blind mask (can't test sybase yet)
- local $SIG{__WARN__} = sub {};
+ local $SIG{__WARN__} = sub { warn @_
+ unless $_[0] =~ /^Formula for Calculation:|^(?:--?|\+|=) Number of (?:self )?references|^Total Number of Referential Constraints|^Details:|^\s*$/ };
my $dbh = $self->schema->storage->dbh;
local $dbh->{FetchHashKeyName} = 'NAME_lc';
=cut
1;
+# vim:et sts=4 sw=4 tw=0:
return \%extra_info;
}
+sub _dbh_column_info {
+ my $self = shift;
+
+ local $SIG{__WARN__} = sub { warn @_
+ unless $_[0] =~ /^column_info: unrecognized column type/ };
+
+ $self->next::method(@_);
+}
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
my $column_accessor_map_tests = 5;
my $num_rescans = 5;
- $num_rescans-- if $self->{vendor} eq 'sybase';
+ $num_rescans-- if $self->{vendor} =~ /^(?:sybase|mysql)\z/i;
plan tests => @connect_info *
(182 + $num_rescans * $column_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));