Author: timbo
Date: Tue Feb  6 05:27:41 2007
New Revision: 8804

Modified:
   dbi/trunk/DBI.xs
   dbi/trunk/lib/DBD/Gofer.pm
   dbi/trunk/t/50dbm.t

Log:
Minor tweaks


Modified: dbi/trunk/DBI.xs
==============================================================================
--- dbi/trunk/DBI.xs    (original)
+++ dbi/trunk/DBI.xs    Tue Feb  6 05:27:41 2007
@@ -209,9 +209,10 @@
 }
 
 /* handy for embedding into condition expression for debugging */
+/*
 static int warn1(char *s) { warn(s); return 1; }
 static int dump1(SV *sv)  { dTHX; sv_dump(sv); return 1; }
-
+*/
 
 /* --- */
 

Modified: dbi/trunk/lib/DBD/Gofer.pm
==============================================================================
--- dbi/trunk/lib/DBD/Gofer.pm  (original)
+++ dbi/trunk/lib/DBD/Gofer.pm  Tue Feb  6 05:27:41 2007
@@ -302,7 +302,7 @@
             && do { local $^W; $value eq $dbh->FETCH($attrib) }; # XXX undefs
 
         # dbh attributes are set at connect-time - see connect()
-        Carp::carp("Can't alter \$dbh->{$attrib}");
+        Carp::carp("Can't alter \$dbh->{$attrib}") if $dbh->FETCH('Warn');
         return $dbh->set_err(1, "Can't alter \$dbh->{$attrib}");
     }
 
@@ -478,11 +478,15 @@
        my ($sth, $attrib, $value) = @_;
        return $sth->SUPER::STORE($attrib => $value)
             if $sth_local_store_attrib{$attrib}  # handle locally
-            or $attrib =~ m/^[a-z]/;             # driver-private
+            or $attrib =~ m/^[a-z]/;             # driver-private XXX
 
-        # XXX could perhaps do
-        # XXX? push @{ $sth->{go_method_calls} }, [ 'STORE', $attrib, $value ];
-        Carp::carp("Can't alter \$sth->{$attrib}");
+        # could perhaps do
+        #   push @{ $sth->{go_method_calls} }, [ 'STORE', $attrib, $value ];
+        # if not $sth->FETCH('Executed')
+        # but how to handle repeat executions? How to we know when an
+        # attribute is being set to affect the current resultset or the
+        # next execution? Could just always use go_method_calls I guess.
+        Carp::carp("Can't alter \$sth->{$attrib}") if $sth->FETCH('Warn');
         return $sth->set_err(1, "Can't alter \$sth->{$attrib}");
     }
 

Modified: dbi/trunk/t/50dbm.t
==============================================================================
--- dbi/trunk/t/50dbm.t (original)
+++ dbi/trunk/t/50dbm.t Tue Feb  6 05:27:41 2007
@@ -28,7 +28,8 @@
 
     if ("@ARGV" eq "all") {
        # test with as many of the major DBM types as are available
-       for (qw( SDBM_File GDBM_File DB_File BerkeleyDB NDBM_File ODBM_File )) {
+        # skip NDBM and ODBM as they don't support EXISTS
+       for (qw( SDBM_File GDBM_File DB_File BerkeleyDB )) {
            push @dbm_types, $_ if eval { local $^W; require "$_.pm" };
        }
     }

Reply via email to