[Bast-commits] r7316 - in DBIx-Class/0.08/trunk: lib/DBIx/Class/Storage t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Aug 13 05:42:52 GMT 2009


Author: ribasushi
Date: 2009-08-13 05:42:51 +0000 (Thu, 13 Aug 2009)
New Revision: 7316

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
   DBIx-Class/0.08/trunk/t/745db2.t
   DBIx-Class/0.08/trunk/t/746db2_400.t
   DBIx-Class/0.08/trunk/t/92storage.t
   DBIx-Class/0.08/trunk/t/93nobindvars.t
Log:
Adjust the storage DESTROY and the tests to accomodate the new global RaiseError=1

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm	2009-08-13 05:41:43 UTC (rev 7315)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm	2009-08-13 05:42:51 UTC (rev 7316)
@@ -2431,8 +2431,13 @@
 
 sub DESTROY {
   my $self = shift;
-  return if !$self->_dbh;
-  $self->_verify_pid;
+  $self->_verify_pid if $self->_dbh;
+
+  # some databases need this to stop spewing warnings
+  if (my $dbh = $self->_dbh) {
+    eval { $dbh->disconnect };
+  }
+
   $self->_dbh(undef);
 }
 

Modified: DBIx-Class/0.08/trunk/t/745db2.t
===================================================================
--- DBIx-Class/0.08/trunk/t/745db2.t	2009-08-13 05:41:43 UTC (rev 7315)
+++ DBIx-Class/0.08/trunk/t/745db2.t	2009-08-13 05:42:51 UTC (rev 7316)
@@ -85,5 +85,6 @@
 
 # clean up our mess
 END {
+    my $dbh = eval { $schema->storage->_dbh };
     $dbh->do("DROP TABLE artist") if $dbh;
 }

Modified: DBIx-Class/0.08/trunk/t/746db2_400.t
===================================================================
--- DBIx-Class/0.08/trunk/t/746db2_400.t	2009-08-13 05:41:43 UTC (rev 7315)
+++ DBIx-Class/0.08/trunk/t/746db2_400.t	2009-08-13 05:42:51 UTC (rev 7316)
@@ -82,6 +82,6 @@
 
 # clean up our mess
 END {
+    my $dbh = eval { $schema->storage->_dbh };
     $dbh->do("DROP TABLE artist") if $dbh;
 }
-

Modified: DBIx-Class/0.08/trunk/t/92storage.t
===================================================================
--- DBIx-Class/0.08/trunk/t/92storage.t	2009-08-13 05:41:43 UTC (rev 7315)
+++ DBIx-Class/0.08/trunk/t/92storage.t	2009-08-13 05:42:51 UTC (rev 7316)
@@ -93,6 +93,7 @@
           'bar',
           undef,
           {
+            %{$storage->_default_dbi_connect_attributes || {} },
             PrintError => 0,
             AutoCommit => 1,
           },
@@ -122,8 +123,8 @@
       args => [
           {
             on_connect_do => [qw/a b c/],
-            PrintError => 0,
-            AutoCommit => 1,
+            PrintError => 1,
+            AutoCommit => 0,
             on_disconnect_do => [qw/d e f/],
             user => 'bar',
             dsn => 'foo',
@@ -138,8 +139,9 @@
           'bar',
           undef,
           {
-            PrintError => 0,
-            AutoCommit => 1,
+            %{$storage->_default_dbi_connect_attributes || {} },
+            PrintError => 1,
+            AutoCommit => 0,
           },
       ],
   },

Modified: DBIx-Class/0.08/trunk/t/93nobindvars.t
===================================================================
--- DBIx-Class/0.08/trunk/t/93nobindvars.t	2009-08-13 05:41:43 UTC (rev 7315)
+++ DBIx-Class/0.08/trunk/t/93nobindvars.t	2009-08-13 05:42:51 UTC (rev 7316)
@@ -65,5 +65,6 @@
 
 # clean up our mess
 END {
+    my $dbh = eval { $schema->storage->_dbh };
     $dbh->do("DROP TABLE artist") if $dbh;
 }




More information about the Bast-commits mailing list