Commit ec5c9e35 authored by Kieron Taylor's avatar Kieron Taylor 😠
Browse files

Enforced strict matching in fetch_by_region synonym lookup. Returns undef,...

Enforced strict matching in fetch_by_region synonym lookup. Returns undef, rather than giving the user what might be the correct answer, and emits a warning. Only allowed to auto-select coordinate system when it is not known.
parent 9430059d
......@@ -297,9 +297,17 @@ sub fetch_by_region {
my $new_name;
my $new_coord_system;
$syn_sql_sth->bind_columns( \$new_name, \$new_coord_system);
if($syn_sql_sth->fetch){
$syn_sql_sth->finish;
return $self->fetch_by_region($new_coord_system, $new_name, $start, $end, $strand, $version, $no_fuzz);
if (not defined($cs)) {
return $self->fetch_by_region($new_coord_system, $new_name, $start, $end, $strand, $version, $no_fuzz);
} elsif ($cs->dbID != $new_coord_system) {
warning("Searched for a known feature on coordinate system: ".$cs->dbID." but found it on: ".$new_coord_system.
"\n No result returned, consider searching without coordinate system or use toplevel.");
return;
}
}
$syn_sql_sth->finish;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment