From: Brandon L. Black <blblack@gmail.com>
Date: Wed, 26 Jul 2006 00:25:24 +0000 (+0000)
Subject: very minor cleanups to columns_info_for
X-Git-Tag: v0.07002~71
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=955f159099804674de35818a97a96a1a2d4ffb68;p=dbsrgits%2FDBIx-Class.git

very minor cleanups to columns_info_for
---

diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm
index 864f8f0..1e95cba 100644
--- a/lib/DBIx/Class/ResultSource.pm
+++ b/lib/DBIx/Class/ResultSource.pm
@@ -188,7 +188,7 @@ sub column_info {
     my $info;
     my $lc_info;
     # eval for the case of storage without table
-    eval { $info = $self->storage->columns_info_for( $self->from, keys %{$self->_columns} ) };
+    eval { $info = $self->storage->columns_info_for( $self->from ) };
     unless ($@) {
       for my $realcol ( keys %{$info} ) {
         $lc_info->{lc $realcol} = $info->{$realcol};
diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm
index 931dd21..9077631 100644
--- a/lib/DBIx/Class/Storage/DBI.pm
+++ b/lib/DBIx/Class/Storage/DBI.pm
@@ -852,10 +852,8 @@ sub columns_info_for {
 
   if ($dbh->can('column_info')) {
     my %result;
-    my $old_raise_err = $dbh->{RaiseError};
-    my $old_print_err = $dbh->{PrintError};
-    $dbh->{RaiseError} = 1;
-    $dbh->{PrintError} = 0;
+    local $dbh->{RaiseError} = 1;
+    local $dbh->{PrintError} = 0;
     eval {
       my ($schema,$tab) = $table =~ /^(.+?)\.(.+)$/ ? ($1,$2) : (undef,$table);
       my $sth = $dbh->column_info( undef,$schema, $tab, '%' );
@@ -878,8 +876,6 @@ sub columns_info_for {
         $result{$col_name} = \%column_info;
       }
     };
-    $dbh->{RaiseError} = $old_raise_err;
-    $dbh->{PrintError} = $old_print_err;
     return \%result if !$@;
   }