Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
ac782802
Commit
ac782802
authored
19 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
fixed bugs in list_dbnames() and _lookup_version() which caused very first db to be missed
parent
84fcb108
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm
+48
-19
48 additions, 19 deletions
modules/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm
with
48 additions
and
19 deletions
modules/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm
+
48
−
19
View file @
ac782802
...
...
@@ -609,13 +609,14 @@ sub list_dbnames {
my
$sql
=
qq(
SELECT old_db_name, new_db_name
FROM mapping_session
ORDER BY created
DE
SC
ORDER BY created
A
SC
)
;
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
();
my
(
$old_db_name
,
$new_db_name
);
my
$first
=
1
;
my
@dbnames
=
();
$sth
->
bind_columns
(
\
$old_db_name
,
\
$new_db_name
);
while
(
$sth
->
fetch
()
)
{
...
...
@@ -623,15 +624,16 @@ sub list_dbnames {
next
;
}
if
(
$first
)
{
$self
->
{'
dbnames
'}
=
[]
;
push
(
@
{
$self
->
{'
dbnames
'}},
$new_db_name
);
push
(
@
{
$self
->
{'
dbnames
'}},
$old_db_name
);
push
(
@dbnames
,
$old_db_name
);
push
(
@dbnames
,
$new_db_name
);
$first
=
0
;
}
else
{
push
(
@
{
$self
->
{'
dbnames
'}}
,
$new_db_name
);
push
(
@dbnames
,
$new_db_name
);
}
}
$sth
->
finish
();
$self
->
{'
dbnames
'}
=
[
reverse
(
@dbnames
)
];
}
return
$self
->
{'
dbnames
'};
...
...
@@ -697,22 +699,24 @@ sub _lookup_version {
my
$sql
;
my
$EXTRA_SQL
=
defined
(
$arch_id
->
{'
type
'})
?
"
and
sie.type = '
@{
[
lc
($
arch_id
->{'
type
'
}
)]}'
"
:
'';
"
AND
sie.type = '
@{
[
lc
($
arch_id
->{'
type
'
}
)]}'
"
:
'';
if
(
!
defined
$arch_id
->
{'
db_name
'}
)
{
# latest version of this stable id
my
$sql_tmp
=
qq(
SELECT
m.new_db_name,
m.new_release,
m.new_assembly,
sie.new_version
FROM stable_id_event sie, mapping_session m
WHERE sie.mapping_session_id = m.mapping_session_id
AND new_stable_id = "@{[$arch_id->stable_id]}" $EXTRA_SQL
ORDER BY m.created DESC
)
;
$sql
=
$self
->
dbc
->
add_limit_clause
(
$sql_tmp
,
1
);
my
$sql_tmp
=
qq(
SELECT
m.new_db_name,
m.new_release,
m.new_assembly,
sie.new_version
FROM stable_id_event sie, mapping_session m
WHERE sie.mapping_session_id = m.mapping_session_id
AND new_stable_id = "@{[$arch_id->stable_id]}"
AND m.new_db_name <> 'LATEST'
$EXTRA_SQL
ORDER BY m.created DESC
)
;
$sql
=
$self
->
dbc
->
add_limit_clause
(
$sql_tmp
,
1
);
}
else
{
$sql
=
qq(
SELECT
...
...
@@ -730,12 +734,37 @@ sub _lookup_version {
my
$id_type
;
my
$sth
=
$self
->
prepare
(
$sql
);
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
();
my
(
$db_name
,
$release
,
$assembly
,
$version
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
();
# you might have missed a stable ID that was deleted in the very first
# stable ID mapping for this species, so go back and try again
if
(
!
defined
$db_name
)
{
my
$sql_tmp
=
qq(
SELECT
m.old_db_name,
m.old_release,
m.old_assembly,
sie.old_version
FROM stable_id_event sie, mapping_session m
WHERE sie.mapping_session_id = m.mapping_session_id
AND old_stable_id = "@{[$arch_id->stable_id]}"
AND m.old_db_name <> 'ALL'
$EXTRA_SQL
ORDER BY m.created DESC
)
;
$sql
=
$self
->
dbc
->
add_limit_clause
(
$sql_tmp
,
1
);
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
();
(
$db_name
,
$release
,
$assembly
,
$version
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
();
}
if
(
!
defined
$db_name
)
{
# couldn't find stable ID in archive
return
0
;
}
else
{
$arch_id
->
version
(
$version
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment