Stop connecting to determine dt-parser (test is in pg branch)
Peter Rabbitson [Fri, 4 Sep 2009 06:47:19 +0000 (06:47 +0000)]
lib/DBIx/Class/Storage/DBI.pm

index a679dfe..af54f1c 100644 (file)
@@ -2487,7 +2487,6 @@ Returns the datetime parser class
 sub datetime_parser {
   my $self = shift;
   return $self->{datetime_parser} ||= do {
-    $self->_populate_dbh unless $self->_dbh;
     $self->build_datetime_parser(@_);
   };
 }
@@ -2508,6 +2507,11 @@ See L</datetime_parser>
 =cut
 
 sub build_datetime_parser {
+  if (not $_[0]->_driver_determined) {
+    $_[0]->_determine_driver;
+    goto $_[0]->can('build_datetime_parser');
+  }
+
   my $self = shift;
   my $type = $self->datetime_parser_type(@_);
   $self->ensure_class_loaded ($type);