From ed88ee2391b510ae5d54fcae9a859d517a7bfa50 Mon Sep 17 00:00:00 2001
From: Andrew Yates <ayates@ebi.ac.uk>
Date: Tue, 20 Mar 2012 15:19:05 +0000
Subject: [PATCH] Escape _ in the input parameters as otherwise we spend a lot
 of time doing very expensive LIKE operations

---
 modules/Bio/EnsEMBL/DBSQL/BaseAlignFeatureAdaptor.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/Bio/EnsEMBL/DBSQL/BaseAlignFeatureAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/BaseAlignFeatureAdaptor.pm
index 6e3a176a6d..aa8c392b3b 100644
--- a/modules/Bio/EnsEMBL/DBSQL/BaseAlignFeatureAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/BaseAlignFeatureAdaptor.pm
@@ -267,6 +267,7 @@ sub fetch_all_by_hit_name_unversioned {
   if ( !defined($hit_name) ) {
     throw("hit_name argument is required");
   }
+  $hit_name =~ s/_/\\_/;
 
   #construct a constraint like 't1.hit_name = "123"'
   my @tabs = $self->_tables;
-- 
GitLab