Author: REHSACK
Date: Fri Oct 15 09:33:21 2010
New Revision: 14488

Modified:
   dbi/branches/sqlengine/lib/DBD/File.pm

Log:
- better phase recognition
- fix RT#61513 (catch $dbh->{$drv_prefix . "_meta"} attribute override)
- clarify NULLABLE attribute a bit


Modified: dbi/branches/sqlengine/lib/DBD/File.pm
==============================================================================
--- dbi/branches/sqlengine/lib/DBD/File.pm      (original)
+++ dbi/branches/sqlengine/lib/DBD/File.pm      Fri Oct 15 09:33:21 2010
@@ -218,7 +218,11 @@
 
     # DBI::BD::SqlEngine::dr::connect will detect old-style drivers and
     # don't call twice
-    defined $phase or $phase = 0;
+    unless (defined $phase) {
+        # we have an "old" driver here
+        $phase = defined $dbh->{sql_init_phase};
+       $phase and $phase = $dbh->{sql_init_phase};
+       }
 
     if (0 == $phase) {
        # f_ext should not be initialized
@@ -281,6 +285,18 @@
            carp "'$value' doesn't look like a valid file extension 
attribute\n";
        }
 
+    (my $drv_class = $dbh->{ImplementorClass}) =~ s/::db$//;
+    my $drv_prefix = DBI->driver_prefix ($drv_class);
+
+    if (exists $dbh->{$drv_prefix . "meta"}) {
+       my $attr = $dbh->{$drv_prefix . "meta"};
+       if ($attrib eq $attr) {
+           while (my ($k, $v) = each %$value) {
+               $dbh->{$attrib}{$k} = $v;
+               }
+           }
+       }
+
     return $dbh->SUPER::validate_STORE_attr ($attrib, $value);
     } # validate_STORE_attr
 
@@ -1145,9 +1161,9 @@
 
 =head4 NULLABLE
 
-Not really working, always returns an array ref of ones, as DBD::CSV
-does not verify input data. Valid after C<< $sth->execute >>; undef for
-non-select statements.
+Not really working, always returns an array ref of ones, except the
+affected table has been created in this session.  Valid after
+C<< $sth->execute >>; undef for non-select statements.
 
 =head3 The following DBI attributes and methods are not supported:
 

Reply via email to