Author: timbo
Date: Mon Mar 14 05:55:54 2005
New Revision: 923

Modified:
   dbi/trunk/Changes
   dbi/trunk/DBI.pm
   dbi/trunk/lib/DBI/DBD/Metadata.pm
Log:
Fixed DBI::DBD::Metadata generation of type_info_all thanks to Steffen Goeldner
 (driver authors who have used it should rerun it).
Registered driver prefixes: amzn_ for DBD::Amazon and yaswi_ for DBD::Yaswi.


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Mon Mar 14 05:55:54 2005
@@ -4,6 +4,14 @@
 
 =cut
 
+=head2 Changes in DBI 1.48 (svn rev XXX),    2nd XXX 2005
+
+  Fixed DBI::DBD::Metadata generation of type_info_all thanks to Steffen 
Goeldner
+    (driver authors who have used it should rerun it).
+
+  Registered driver prefixes: amzn_ for DBD::Amazon and yaswi_ for DBD::Yaswi.
+
+
 =head2 Changes in DBI 1.47 (svn rev 854),    2nd February 2005
 
   Fixed DBI::ProxyServer to not create pid files by default.

Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm    (original)
+++ dbi/trunk/DBI.pm    Mon Mar 14 05:55:54 2005
@@ -295,6 +295,7 @@
 my $dbd_prefix_registry = {
   ad_      => { class => 'DBD::AnyData',       },
   ado_     => { class => 'DBD::ADO',           },
+  amzn_    => { class => 'DBD::Amazon',                },
   best_    => { class => 'DBD::BestWins',      },
   csv_     => { class => 'DBD::CSV',           },
   db2_     => { class => 'DBD::DB2',           },
@@ -328,6 +329,7 @@
   uni_     => { class => 'DBD::Unify',         },
   xbase_   => { class => 'DBD::XBase',         },
   xl_      => { class => 'DBD::Excel',         },
+  yaswi_   => { class => 'DBD::Yaswi',         },
 };
 
 sub dump_dbd_registry {
@@ -3339,9 +3341,25 @@
 
 Typically C<RaiseError> is used in conjunction with C<eval { ... }>
 to catch the exception that's been thrown and followed by an
-C<if ($@) { ... }> block to handle the caught exception. In that eval
-block the $DBI::lasth variable can be useful for diagnosis and reporting.
-For example, $DBI::lasth->{Type} and $DBI::lasth->{Statement}.
+C<if ($@) { ... }> block to handle the caught exception.
+For example:
+
+  eval {
+    ...
+    $sth->execute();
+    ...
+  };
+  if ($@) {
+    # $sth->err and $DBI::err will be true if error was from DBI
+    warn $@; # print the error
+    ... # do whatever you need to deal with the error
+  }
+
+In that eval block the $DBI::lasth variable can be useful for
+diagnosis and reporting if you can't be sure which handle triggered
+the error.  For example, $DBI::lasth->{Type} and $DBI::lasth->{Statement}.
+
+See also L</Transactions>.
 
 If you want to temporarily turn C<RaiseError> off (inside a library function
 that is likely to fail, for example), the recommended way is like this:

Modified: dbi/trunk/lib/DBI/DBD/Metadata.pm
==============================================================================
--- dbi/trunk/lib/DBI/DBD/Metadata.pm   (original)
+++ dbi/trunk/lib/DBI/DBD/Metadata.pm   Mon Mar 14 05:55:54 2005
@@ -243,7 +243,7 @@
   sub type_info_all {
     my ($dbh) = @_;
     require DBD::Driver::TypeInfo;
-    return $DBD::Driver::TypeInfo::type_info_all;
+    return [ @$DBD::Driver::TypeInfo::type_info_all ];
   }
 
 Please replace Driver (or "<foo>") with the name of your driver.
@@ -326,7 +326,7 @@
     {
         my (\$dbh) = [EMAIL PROTECTED];
         require DBD::${driver}::TypeInfo;
-        return \$DBD::${driver}::TypeInfo::type_info_all;
+        return [ [EMAIL PROTECTED]::${driver}::TypeInfo::type_info_all ];
     }
 
 # Transfer this to lib/DBD/${driver}/TypeInfo.pm.

Reply via email to