Author: timbo
Date: Thu Apr 22 03:41:37 2010
New Revision: 13911

Modified:
   dbi/trunk/lib/DBI/PurePerl.pm
   dbi/trunk/t/90sql_type_cast.t

Log:
Fixed "Argument "aa" isn't numeric in addition" warnings from 
t/zvp_90sql_type_cast.t
Only warn in PurePerl sql_type_cast if warnings are enabled.


Modified: dbi/trunk/lib/DBI/PurePerl.pm
==============================================================================
--- dbi/trunk/lib/DBI/PurePerl.pm       (original)
+++ dbi/trunk/lib/DBI/PurePerl.pm       Thu Apr 22 03:41:37 2010
@@ -701,7 +701,7 @@
         else {
             return -2;
         }
-    } or warn $@;
+    } or $^W && warn $@; # XXX warnings::warnif("numeric", $@) ?
 
     return $evalret if defined($evalret) && ($evalret == -2);
     $cast_ok = 0 unless $evalret;

Modified: dbi/trunk/t/90sql_type_cast.t
==============================================================================
--- dbi/trunk/t/90sql_type_cast.t       (original)
+++ dbi/trunk/t/90sql_type_cast.t       Thu Apr 22 03:41:37 2010
@@ -105,7 +105,8 @@
     #diag(join(",", map {neat($_)} Data::Peek::DDual($val)));
     my $result;
     {
-        no warnings;
+        no warnings;   # lexical but also affects XS sub
+        local $^W = 0; # needed for PurePerl tests
         $result = sql_type_cast($val, $test->[2], $test->[3]);
     }
     is($result, $test->[4], "result, $test->[0]");

Reply via email to