[svn:dbi] r14050 - dbi/trunk/lib/DBI/SQL

[email protected]
Newsgroups perl.dbi.changes
Message-ID <[email protected]>
Author: REHSACK
Date: Tue May 25 13:43:55 2010
New Revision: 14050

Modified:
   dbi/trunk/lib/DBI/SQL/Nano.pm

Log:
Prevent DBD::File sees a warning we don't want to share (DROP TABLE IF EXISTS ...)

Modified: dbi/trunk/lib/DBI/SQL/Nano.pm
==============================================================================
--- dbi/trunk/lib/DBI/SQL/Nano.pm	(original)
+++ dbi/trunk/lib/DBI/SQL/Nano.pm	Tue May 25 13:43:55 2010
@@ -284,13 +284,18 @@
     my ( $self, $data, $params ) = @_;
 
     my $table;
-    eval { ($table) = $self->open_tables( $data, 0, 1 ); };
-    if ( $self->{ignore_missing_table} and $@ and $@ =~ m/no such (table|file)/i )
+    my @err;
+    eval {
+	local $SIG{__WARN__} = sub { push @err, @_ };
+	($table) = $self->open_tables( $data, 0, 1 );
+    };
+    if ( $self->{ignore_missing_table} and ($@ or @err) and grep { m/no such (table|file)/i } (@err, $@) )
     {
+	$@ = '';
         return ( -1, 0 );
     }
 
-    $self->do_err($@) if ($@);
+    $self->do_err($@ || $err[0]) if ($@ || @err);
     return ( -1, 0 ) unless $table;
 
     $table->drop($data);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.