From d3ae6172994393435dde1d0448b472ade6929628 Mon Sep 17 00:00:00 2001 From: Chris Fields Date: Thu, 7 Apr 2011 15:46:50 -0500 Subject: [PATCH] enable fast loading with namespaces; empty tables were being generated that had concatenated table names via _qualify() (e.g. volvox_volvox_feature); this fix checks for the presence of the namespace just in case and returns it w/o modification if it is found --- Bio/DB/SeqFeature/Store/DBI/mysql.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Bio/DB/SeqFeature/Store/DBI/mysql.pm b/Bio/DB/SeqFeature/Store/DBI/mysql.pm index f9a217093..d6191fa7a 100644 --- a/Bio/DB/SeqFeature/Store/DBI/mysql.pm +++ b/Bio/DB/SeqFeature/Store/DBI/mysql.pm @@ -566,12 +566,14 @@ sub _finish_bulk_update { my $fh = $self->dump_filehandle($table); my $path = $self->dump_path($table); $fh->close; + print STDERR "$path\n"; + $dbh->do("LOAD DATA LOCAL INFILE '$path' REPLACE INTO TABLE $table FIELDS OPTIONALLY ENCLOSED BY '\\''") or $self->throw($dbh->errstr); unlink $path; } delete $self->{bulk_update_in_progress}; - delete $self->{filehandles}; + delete $self->{ filehandles}; $self->commit; } @@ -736,7 +738,9 @@ sub _qualify { my $self = shift; my $table_name = shift; my $namespace = $self->namespace; - return $table_name unless defined $namespace; + return $table_name if (!defined $namespace || + # is namespace already present in table name? + index($table_name, $namespace) == 0); return "${namespace}_${table_name}"; } -- 2.11.4.GIT