[Bioperl-guts-l] [14827] bioperl-live/trunk/Bio/DB: set the mysql autoreconnect flag

Lincoln Stein lstein at dev.open-bio.org
Mon Aug 25 19:35:42 EDT 2008


Revision: 14827
Author:   lstein
Date:     2008-08-25 19:35:42 -0400 (Mon, 25 Aug 2008)

Log Message:
-----------
set the mysql autoreconnect flag

Modified Paths:
--------------
    bioperl-live/trunk/Bio/DB/GFF/Adaptor/dbi/caching_handle.pm
    bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm
    bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm

Modified: bioperl-live/trunk/Bio/DB/GFF/Adaptor/dbi/caching_handle.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/GFF/Adaptor/dbi/caching_handle.pm	2008-08-25 17:42:05 UTC (rev 14826)
+++ bioperl-live/trunk/Bio/DB/GFF/Adaptor/dbi/caching_handle.pm	2008-08-25 23:35:42 UTC (rev 14827)
@@ -138,6 +138,7 @@
   # for Oracle - to retrieve LOBs, need to define the length (Jul 15, 2002)
   $dbh->{LongReadLen} = 100*65535;
   $dbh->{LongTruncOk} = 0;
+  $dbh->{mysql_auto_reconnect} = 1;
 
   my $wrapper = Bio::DB::GFF::Adaptor::dbi::faux_dbh->new($dbh);
   push @{$self->{dbh}},$wrapper;

Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm	2008-08-25 17:42:05 UTC (rev 14826)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/DBI/mysql.pm	2008-08-25 23:35:42 UTC (rev 14827)
@@ -209,6 +209,7 @@
   } else {
     $dsn = "dbi:mysql:$dsn" unless $dsn =~ /^dbi:/;
     $dbh = DBI->connect($dsn,$user,$pass,$dbi_options) or $self->throw($DBI::errstr);
+    $dbh->{mysql_auto_reconnect} = 1;
   }
   $self->{dbh}       = $dbh;
   $self->{is_temp}   = $is_temporary;
@@ -842,6 +843,8 @@
   my $self = shift;
   my ($search_string,$attribute_names,$limit) = @_;
   my @words               = map {quotemeta($_)} split /\s+/,$search_string;
+#  return unless @words;
+
   my $name_table          = $self->_name_table;
   my $attribute_table     = $self->_attribute_table;
   my $attributelist_table = $self->_attributelist_table;

Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm	2008-08-25 17:42:05 UTC (rev 14826)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/GFF3Loader.pm	2008-08-25 23:35:42 UTC (rev 14827)
@@ -386,6 +386,7 @@
       if (++$load_data->{count} % 1000 == 0) {
 	my $now = $self->time();
 	my $nl = -t STDOUT && !$ENV{EMACS} ? "\r" : "\n";
+	local $^W = 0; # kill uninit variable warning
 	$self->msg(sprintf("%d features loaded in %5.2fs (%5.2fs/1000 features)...%s$nl",
 			   $load_data->{count},$now - $load_data->{start_time},
 			   $now - $load_data->{millenium_time},
@@ -468,8 +469,11 @@
   my @columns = map {$_ eq '.' ? undef : $_ } split /\t/,$gff_line;
   return unless @columns >= 8;
 
-  if (@columns > 9) { #oops, split too much due to whitespace
-      $columns[8] = join(' ', at columns[8..$#columns]);
+  {
+      local $^W = 0;
+      if (@columns > 9) { #oops, split too much due to whitespace
+	  $columns[8] = join(' ', at columns[8..$#columns]);
+      }
   }
 
   my ($refname,$source,$method,$start,$end, $score,$strand,$phase,$attributes) = @columns;




More information about the Bioperl-guts-l mailing list