From: Jess Robinson Date: Mon, 24 Jul 2006 12:16:00 +0000 (+0000) Subject: 1) Add an explicit error to columns_info_for if the given schema/table combination... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=099049b53886d1ca65db05e3dcfdd1ce0dd11679;p=dbsrgits%2FDBIx-Class-Historic.git 1) Add an explicit error to columns_info_for if the given schema/table combination produces no results. 2) Upper case the input for Oracle. --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 7c70bc6..931dd21 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -860,6 +860,12 @@ sub columns_info_for { my ($schema,$tab) = $table =~ /^(.+?)\.(.+)$/ ? ($1,$2) : (undef,$table); my $sth = $dbh->column_info( undef,$schema, $tab, '%' ); $sth->execute(); + + # Some error occured or there is no information: + if($sth->rows <1) { + die "column_info returned no rows for $schema, $tab"; + } + while ( my $info = $sth->fetchrow_hashref() ){ my %column_info; $column_info{data_type} = $info->{TYPE_NAME}; diff --git a/lib/DBIx/Class/Storage/DBI/Oracle.pm b/lib/DBIx/Class/Storage/DBI/Oracle.pm index cd5449b..935d46b 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle.pm @@ -38,6 +38,13 @@ sub get_autoinc_seq { croak "Unable to find a sequence INSERT trigger on table '" . $source->name . "'."; } +sub columns_info_for { + my ($self, $table) = @_; + + $self->next::columns_info_for($self, uc($table)); +} + + 1; =head1 NAME